+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
}
$params['amount_level'] = $this->_params[0]['amount_level'];
$params['currencyID'] = $this->_params[0]['currencyID'];
- $params['payment_action'] = 'Sale';
// also merge all the other values from the profile fields
$values = $this->controller->exportValues('Register');
if ($this->_values['event']['is_monetary']) {
$registerParams['ip_address'] = CRM_Utils_System::ipAddress();
$registerParams['currencyID'] = $this->_params[0]['currencyID'];
- $registerParams['payment_action'] = 'Sale';
}
//assign back primary participant params.
$this->_params[0] = $registerParams;
$taxAmount = 0;
foreach ($this->_params as $k => $v) {
+ $individualTaxAmount = 0;
//display tax amount on confirmation page
$taxAmount += $v['tax_amount'];
if (is_array($v)) {
if (empty($v['first_name'])) {
$this->_part[$k]['info'] = $append;
}
+
+ /*CRM-16320 */
+ $individual[$k]['totalAmtWithTax'] = $this->_amount[$k]['amount'];
+ $individual[$k]['totalTaxAmt'] = $individualTaxAmount + $v['tax_amount'];
$this->_totalAmount = $this->_totalAmount + $this->_amount[$k]['amount'];
if (!empty($v['is_primary'])) {
$this->set('primaryParticipantAmount', $this->_amount[$k]['amount']);
if ($invoicing) {
$this->assign('totalTaxAmount', $taxAmount);
$this->assign('taxTerm', $taxTerm);
+ $this->assign('individual', $individual);
+ $this->set('individual', $individual);
}
+
$this->assign('part', $this->_part);
$this->set('part', $this->_part);
$this->assign('amounts', $this->_amount);
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$lineItemForTemplate = array();
$getTaxDetails = FALSE;
- foreach ($this->_lineItem as $key => $value) {
- if (!empty($value)) {
- $lineItemForTemplate[$key] = $value;
- }
- if ($invoicing) {
- foreach ($value as $v) {
- if (isset($v['tax_rate'])) {
- $getTaxDetails = TRUE;
+ if (!empty($this->_lineItem) && is_array($this->_lineItem)) {
+ foreach ($this->_lineItem as $key => $value) {
+ if (!empty($value)) {
+ $lineItemForTemplate[$key] = $value;
+ }
+ if ($invoicing) {
+ foreach ($value as $v) {
+ if (isset($v['tax_rate'])) {
+ $getTaxDetails = TRUE;
+ }
}
}
}
) {
$priceSetErrors = self::validatePriceSet($self, $self->_params);
if (!empty($priceSetErrors)) {
- CRM_Core_Session::setStatus(ts('You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish. The following events were sold out:'), ts('Unfortunately some of your options have now sold out for one or more participants.'), 'error');
+ CRM_Core_Session::setStatus(ts('You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish.'), ts('Unfortunately some of your options have now sold out for one or more participants.'), 'error');
CRM_Core_Session::setStatus(ts('Please note that the options which are marked or selected are sold out for participant being viewed.'), ts('Sold out:'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/register', "_qf_Register_display=true&qfKey={$fields['qfKey']}"));
}
$this->_values['event']
);
+ $pending = FALSE;
+ if ($this->_allowWaitlist || $this->_requireApproval) {
+ //get the participant statuses.
+ $waitingStatuses = CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Waiting'");
+ if ($this->_allowWaitlist) {
+ $value['participant_status_id'] = $value['participant_status'] = array_search('On waitlist', $waitingStatuses);
+ }
+ else {
+ $value['participant_status_id'] = $value['participant_status'] = array_search('Awaiting approval', $waitingStatuses);
+ }
+
+ //there might be case user seleted pay later and
+ //now becomes part of run time waiting list.
+ $value['is_pay_later'] = FALSE;
+ }
+
// required only if paid event
- if ($this->_values['event']['is_monetary']) {
+ if ($this->_values['event']['is_monetary'] && !($this->_allowWaitlist || $this->_requireApproval)) {
if (is_array($this->_paymentProcessor)) {
$payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);
}
- $pending = FALSE;
$result = NULL;
- if ($this->_allowWaitlist || $this->_requireApproval) {
- //get the participant statuses.
- $waitingStatuses = CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Waiting'");
- if ($this->_allowWaitlist) {
- $value['participant_status_id'] = $value['participant_status'] = array_search('On waitlist', $waitingStatuses);
- }
- else {
- $value['participant_status_id'] = $value['participant_status'] = array_search('Awaiting approval', $waitingStatuses);
- }
-
- //there might be case user seleted pay later and
- //now becomes part of run time waiting list.
- $value['is_pay_later'] = FALSE;
- }
- elseif (!empty($value['is_pay_later']) ||
+ if (!empty($value['is_pay_later']) ||
$value['amount'] == 0 ||
$this->_contributeMode == 'checkout' ||
$this->_contributeMode == 'notify'
}
}
- //update status and send mail to cancelled additonal participants, CRM-4320
+ //update status and send mail to cancelled additional participants, CRM-4320
if ($this->_allowConfirmation && is_array($cancelledIds) && !empty($cancelledIds)) {
$cancelledId = array_search('Cancelled',
CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Negative'")
if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
$lineItem[] = $lineItemValue;
}
+ if ($invoicing) {
+ $individual = $this->get('individual');
+ $dataArray[key($dataArray)] = $individual[$participantNum]['totalTaxAmt'];
+ $this->assign('dataArray', $dataArray);
+ $this->assign('totalAmount', $individual[$participantNum]['totalAmtWithTax']);
+ $this->assign('totalTaxAmount', $individual[$participantNum]['totalTaxAmt']);
+ $this->assign('individual', array($individual[$participantNum]));
+ }
$this->assign('lineItem', $lineItem);
}
$this->_values['params']['additionalParticipant'] = TRUE;