add token for refund amount

This commit is contained in:
2016-05-13 12:09:22 +10:00
parent b8560c878a
commit 32d2e1692d

View File

@@ -563,6 +563,10 @@ function booking_token_info() {
'name' => t('Payment Required'), 'name' => t('Payment Required'),
'description' => t('The total amount required to complete the registration.') 'description' => t('The total amount required to complete the registration.')
); );
$info['tokens']['booking']['refund-due'] = array(
'name' => t('Refund Due'),
'description' => t('The amount due as a refund.')
);
$info['tokens']['booking']['balance-payment-link'] = array( $info['tokens']['booking']['balance-payment-link'] = array(
'name' => t('Balance Payment Link'), 'name' => t('Balance Payment Link'),
'description' => t('If using paypal, the link to the balance payment page.') 'description' => t('If using paypal, the link to the balance payment page.')
@@ -730,9 +734,8 @@ function booking_define_personspecific_tokens($node)
$tokens['lname'] = ucwords(trim($node->booking_lastname)); $tokens['lname'] = ucwords(trim($node->booking_lastname));
$tokens['dietary'] = ucwords(trim($node->booking_dietary)); $tokens['dietary'] = ucwords(trim($node->booking_dietary));
$tokens['booking-id'] = $node->nid; $tokens['booking-id'] = $node->nid;
//$tokens['payment-required'] = $node->booking_total_pay_reqd - $amount_paid;
//$tokens['payment-required'] = _booking_amount_owing($node->nid, $amount_paid, FALSE);
$tokens['payment-required'] = _booking_amount_owing($node, $amount_paid, FALSE); $tokens['payment-required'] = _booking_amount_owing($node, $amount_paid, FALSE);
$tokens['refund-due'] = $node->booking_refund_due;
$tokens['waitinglist-position'] = $result->num_ppl - variable_get('booking_regn_limit',350) + 1; $tokens['waitinglist-position'] = $result->num_ppl - variable_get('booking_regn_limit',350) + 1;
$tokens['payment-transaction-desc'] = $node->nid . ' ' . $node->booking_lastname; $tokens['payment-transaction-desc'] = $node->nid . ' ' . $node->booking_lastname;
$tokens['balance-payment-link'] = url('balance/' . $tempid, array('absolute' => TRUE)); $tokens['balance-payment-link'] = url('balance/' . $tempid, array('absolute' => TRUE));