Adding travel form
This commit is contained in:
@@ -425,7 +425,7 @@ function _booking_amount_paid($nid, $person = NULL)
|
||||
//check for a spouse
|
||||
if ($person->booking_partner_id > 0)
|
||||
{
|
||||
watchdog('booking', "Checking total paid for married person");
|
||||
//watchdog('booking', "Checking total paid for married person");
|
||||
|
||||
//if we're combining the payment for married couples
|
||||
if (variable_get('booking_enable_combined_pricing', 0) == 1)
|
||||
@@ -446,7 +446,7 @@ function _booking_amount_paid($nid, $person = NULL)
|
||||
foreach ($query as $payment)
|
||||
$amount_paid += ($payment->booking_mc_gross - $payment->booking_mc_fee);
|
||||
|
||||
watchdog('booking', "Total amount paid according to paypal payments table is " . $amount_paid);
|
||||
//watchdog('booking', "Total amount paid according to paypal payments table is " . $amount_paid);
|
||||
|
||||
//if there were no results, $amount_paid will still be 0
|
||||
if ($amount_paid == 0)
|
||||
@@ -460,12 +460,12 @@ function _booking_amount_paid($nid, $person = NULL)
|
||||
array(':nid' => $person->booking_partner_id))
|
||||
->fetchObject();
|
||||
$amount_paid = $person->booking_amount_paid + $spouse->booking_amount_paid;
|
||||
watchdog('booking', "Total combined payments for couple based on totals in booking_person table is " . $amount_paid);
|
||||
//watchdog('booking', "Total combined payments for couple based on totals in booking_person table is " . $amount_paid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$amount_paid = $person->booking_amount_paid;
|
||||
watchdog('booking', "Total amount paid for individual based on totals in booking_person table is " . $amount_paid);
|
||||
//watchdog('booking', "Total amount paid for individual based on totals in booking_person table is " . $amount_paid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -488,7 +488,7 @@ function _booking_amount_paid($nid, $person = NULL)
|
||||
// $amount_paid = $person->booking_amount_paid;
|
||||
}
|
||||
|
||||
watchdog('booking', "Total amount already paid for this registration " . $nid . " is " . $amount_paid);
|
||||
//watchdog('booking', "Total amount already paid for this registration " . $nid . " is " . $amount_paid);
|
||||
|
||||
return $amount_paid;
|
||||
}
|
||||
@@ -501,7 +501,7 @@ function _booking_amount_owing($nid, $amount_paid = 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_total_pay_reqd, person.booking_amount_paid, person.booking_partner_id, person.booking_country " .
|
||||
"FROM {booking_person} person, {booking_price} price " .
|
||||
"WHERE person.nid = :nid " .
|
||||
"AND person.booking_payment_id = price.pid",
|
||||
@@ -514,12 +514,12 @@ function _booking_amount_owing($nid, $amount_paid = 0)
|
||||
else
|
||||
$total_due = $person->booking_late_price;
|
||||
|
||||
watchdog('booking', "Total amount due for this registration " . $nid . " is " . $total_due);
|
||||
//watchdog('booking', "Total amount due for this registration " . $nid . " is " . $total_due);
|
||||
|
||||
//if we didn't get the amount paid as a command line parameter, check it now
|
||||
if ($amount_paid == 0)
|
||||
{
|
||||
watchdog('booking', "Checking total amount already paid by " . $nid);
|
||||
//watchdog('booking', "Checking total amount already paid by " . $nid);
|
||||
$amount_paid = _booking_amount_paid($nid, $person);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ function _booking_amount_owing($nid, $amount_paid = 0)
|
||||
|
||||
if ($amount_paid >= $total_due)
|
||||
{
|
||||
watchdog('booking', "This person doesn't owe any money: @info", array('@info' => var_export($person, TRUE)));
|
||||
//watchdog('booking', "This person doesn't owe any money: @info", array('@info' => var_export($person, TRUE)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,11 @@ function _booking_amount_owing($nid, $amount_paid = 0)
|
||||
//add the 30 cent fixed cost
|
||||
$amount_owing = $total_due - $amount_paid + 0.3;
|
||||
//and the 2.4 percent transaction fee
|
||||
$amount_owing = $amount_owing / (1 - 0.024);
|
||||
if ($person->booking_country === "Australia")
|
||||
$amount_owing = $amount_owing / (1 - 0.024);
|
||||
//paypal charges 3.4 percent if they're doing a currency conversion
|
||||
else
|
||||
$amount_owing = $amount_owing / (1 - 0.034);
|
||||
}
|
||||
else
|
||||
$amount_owing = $total_due - $amount_paid;
|
||||
|
Reference in New Issue
Block a user