Bugfixes relating to early bird rate closing

This commit is contained in:
2014-03-01 00:37:39 +11:00
parent 8fb838d9eb
commit 97dc20354a
4 changed files with 17 additions and 23 deletions

View File

@@ -552,7 +552,7 @@ function _booking_amount_paid($nid, $person = NULL)
}
//calculate the amount outstanding for a person/married couple
function _booking_amount_owing($nid, $amount_paid = 0)
function _booking_amount_owing($nid, $amount_paid = 0, $include_paypal_fees = TRUE)
{
//$amount_paid = 0;
$total_due = 0;
@@ -579,23 +579,21 @@ function _booking_amount_owing($nid, $amount_paid = 0)
//finally we must be in the late-fee period
else
$total_due = $person->booking_late_price;
//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)
{
$amount_paid = _booking_amount_paid($nid, $person);
}
//check if there is anything outstanding
if ($amount_paid >= $total_due)
if ($amount_paid >= $person->booking_total_pay_reqd)
{
//watchdog('booking', "This person doesn't owe any money: @info", array('@info' => var_export($person, TRUE)));
return 0;
}
//if we're using paypal, add the transaction fee
if (variable_get('booking_use_paypal', 0) == 1)
if (variable_get('booking_use_paypal', 0) == 1 && $include_paypal_fees == TRUE)
{
//add the 30 cent fixed cost
$amount_owing = $total_due - $amount_paid + 0.3;