<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_ContributionBase {
/**
- * membership price set status
+ * Membership price set status
*
*/
public $_useForMember;
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @return void
- * @access public
*/
public function preProcess() {
parent::preProcess();
}
/**
- * overwrite action, since we are only showing elements in frozen mode
+ * Overwrite action, since we are only showing elements in frozen mode
* no help display needed
*
* @return int
- * @access public
*/
- function getAction() {
+ public function getAction() {
if ($this->_action & CRM_Core_Action::PREVIEW) {
return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW;
}
}
/**
- * Function to actually build the form
+ * Build the form object
*
* @return void
- * @access public
*/
public function buildQuickForm() {
$this->assignToTemplate();
$this->assign('useForMember', $this->get('useForMember'));
$params = $this->_params;
+ $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+ $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ if ($invoicing) {
+ $getTaxDetails = FALSE;
+ $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
+ foreach ($this->_lineItem as $key => $value) {
+ foreach ($value as $v) {
+ if (isset($v['tax_rate'])) {
+ if ($v['tax_rate'] != '') {
+ $getTaxDetails = TRUE;
+ }
+ }
+ }
+ }
+ $this->assign('getTaxDetails', $getTaxDetails);
+ $this->assign('taxTerm', $taxTerm);
+ $this->assign('totalTaxAmount', $params['tax_amount']);
+ }
if ($this->_honor_block_is_active && !empty($params['soft_credit_type_id'])) {
$honorName = null;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
}
}
- // now fix all state country selectors
- CRM_Core_BAO_Address::fixAllStateSelects($this, $defaults);
-
$this->_submitValues = array_merge($this->_submitValues, $defaults);
$this->setDefaults($defaults);
$this->controller->reset();
}
}
-