3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
37 * Business objects for managing price fields.
40 class CRM_Price_BAO_PriceField
extends CRM_Price_DAO_PriceField
{
45 * takes an associative array and creates a price field object
47 * the function extract all the params it needs to initialize the create a
48 * price field object. the params array could contain additional unused name/value
51 * @param array $params (reference ) an assoc array of name/value pairs
53 * @internal param array $ids the array that holds all the db ids
55 * @return object CRM_Price_BAO_PriceField object
59 static function add(&$params) {
60 $priceFieldBAO = new CRM_Price_BAO_PriceField();
62 $priceFieldBAO->copyValues($params);
64 if ($id = CRM_Utils_Array
::value('id', $params)) {
65 $priceFieldBAO->id
= $id;
68 $priceFieldBAO->save();
69 return $priceFieldBAO;
73 * takes an associative array and creates a price field object
75 * This function is invoked from within the web form layer and also from the api layer
77 * @param array $params (reference) an assoc array of name/value pairs
79 * @return object CRM_Price_DAO_PriceField object
83 static function create(&$params) {
84 if(empty($params['id']) && empty($params['name'])) {
85 $params['name'] = strtolower(CRM_Utils_String
::munge($params['label'], '_', 242));
87 $transaction = new CRM_Core_Transaction();
89 $priceField = self
::add($params);
91 if (is_a($priceField, 'CRM_Core_Error')) {
92 $transaction->rollback();
96 $optionsIds = array();
97 $maxIndex = CRM_Price_Form_Field
::NUM_OPTION
;
99 if ($priceField->html_type
== 'Text') {
102 $fieldValue = new CRM_Price_DAO_PriceFieldValue();
103 $fieldValue->price_field_id
= $priceField->id
;
105 // update previous field values( if any )
106 if ($fieldValue->find(TRUE)) {
107 $optionsIds['id'] = $fieldValue->id
;
110 $defaultArray = array();
111 //html type would be empty in update scenario not sure what would happen ...
112 if (!empty($params['html_type']) && $params['html_type'] == 'CheckBox' && isset($params['default_checkbox_option'])) {
113 $tempArray = array_keys($params['default_checkbox_option']);
114 foreach ($tempArray as $v) {
115 if ($params['option_amount'][$v]) {
116 $defaultArray[$v] = 1;
121 if (!empty($params['default_option'])) {
122 $defaultArray[$params['default_option']] = 1;
126 for ($index = 1; $index <= $maxIndex; $index++
) {
127 if (array_key_exists('option_amount', $params) &&
128 array_key_exists($index, $params['option_amount']) &&
129 (CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('option_label', $params)) ||
!empty($params['is_quick_config'])) &&
130 !CRM_Utils_System
::isNull($params['option_amount'][$index])
133 'price_field_id' => $priceField->id
,
134 'label' => trim($params['option_label'][$index]),
135 'name' => CRM_Utils_String
::munge($params['option_label'][$index], '_', 64),
136 'amount' => CRM_Utils_Rule
::cleanMoney(trim($params['option_amount'][$index])),
137 'count' => CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('option_count', $params), NULL),
138 'max_value' => CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('option_max_value', $params), NULL),
139 'description' => CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('option_description', $params), NULL),
140 'membership_type_id' => CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('membership_type_id', $params), NULL),
141 'weight' => $params['option_weight'][$index],
143 'is_default' => CRM_Utils_Array
::value($params['option_weight'][$index], $defaultArray) ?
$defaultArray[$params['option_weight'][$index]] : 0,
144 'membership_num_terms' => NULL,
147 if ($options['membership_type_id']) {
148 $options['membership_num_terms'] = CRM_Utils_Array
::value($index, CRM_Utils_Array
::value('membership_num_terms', $params), 1);
151 if (CRM_Utils_Array
::value( $index, CRM_Utils_Array
::value('option_financial_type_id', $params))) {
152 $options['financial_type_id'] = $params['option_financial_type_id'][$index];
153 } elseif (!empty($params['financial_type_id'])) {
154 $options['financial_type_id'] = $params['financial_type_id'];
157 if ($opIds = CRM_Utils_Array
::value('option_id', $params)) {
158 if ($opId = CRM_Utils_Array
::value($index, $opIds)) {
159 $optionsIds['id'] = $opId;
161 $optionsIds['id'] = NULL;
164 CRM_Price_BAO_PriceFieldValue
::create($options, $optionsIds);
168 $transaction->commit();
173 * Takes a bunch of params that are needed to match certain criteria and
174 * retrieves the relevant objects. Typically the valid params are only
175 * contact_id. We'll tweak this function to be more full featured over a period
176 * of time. This is the inverse function of create. It also stores all the retrieved
177 * values in the default array
179 * @param array $params (reference ) an assoc array of name/value pairs
180 * @param array $defaults (reference ) an assoc array to hold the flattened values
182 * @return object CRM_Price_DAO_PriceField object
186 static function retrieve(&$params, &$defaults) {
187 return CRM_Core_DAO
::commonRetrieve('CRM_Price_DAO_PriceField', $params, $defaults);
191 * update the is_active flag in the db
193 * @param int $id Id of the database record
194 * @param boolean $is_active Value we want to set the is_active field
196 * @return Object DAO object on sucess, null otherwise
201 static function setIsActive($id, $is_active) {
202 return CRM_Core_DAO
::setFieldValue('CRM_Price_DAO_PriceField', $id, 'is_active', $is_active);
206 * Get the field title.
208 * @param int $id id of field.
210 * @return string name
216 public static function getTitle($id) {
217 return CRM_Core_DAO
::getFieldValue('CRM_Price_DAO_PriceField', $id, 'label');
221 * This function for building custom fields
223 * @param CRM_Core_Form $qf form object (reference)
224 * @param string $elementName name of the custom field
226 * @param boolean $inactiveNeeded
227 * @param boolean $useRequired true if required else false
228 * @param string $label label for custom field
230 * @param null $fieldOptions
231 * @param array $feezeOptions
234 * @internal param bool $search true if used for search else false
238 public static function addQuickFormElement(&$qf,
244 $fieldOptions = NULL,
245 $feezeOptions = array()
248 $field = new CRM_Price_DAO_PriceField();
249 $field->id
= $fieldId;
250 if (!$field->find(TRUE)) {
251 /* FIXME: failure! */
256 if (isset($qf->_mode
) && empty($qf->_mode
)) {
259 elseif (isset($qf->_values
)) {
260 $is_pay_later = CRM_Utils_Array
::value( 'is_pay_later', $qf->_values
);
263 $otherAmount = $qf->get('values');
264 $config = CRM_Core_Config
::singleton();
265 $currencySymbol = CRM_Core_DAO
::getFieldValue('CRM_Financial_DAO_Currency',$config->defaultCurrency
,'symbol','name');
266 $qf->assign('currencySymbol', $currencySymbol);
267 // get currency name for price field and option attributes
268 $currencyName = $config->defaultCurrency
;
270 if (!isset($label)) {
271 $label = (!empty($qf->_membershipBlock
) && $field->name
== 'contribution_amount') ?
ts('Additional Contribution') : $field->label
;
274 if ($field->name
== 'contribution_amount') {
275 $qf->_contributionAmount
= 1;
278 if (isset($qf->_online
) && $qf->_online
) {
279 $useRequired = FALSE;
282 $customOption = $fieldOptions;
283 if (!is_array($customOption)) {
284 $customOption = CRM_Price_BAO_PriceField
::getOptions($field->id
, $inactiveNeeded);
288 $valueFieldName = 'amount';
290 $invoiceSettings = CRM_Core_BAO_Setting
::getItem(CRM_Core_BAO_Setting
::CONTRIBUTE_PREFERENCES_NAME
, 'contribution_invoice_settings');
291 $taxTerm = CRM_Utils_Array
::value('tax_term', $invoiceSettings);
292 $displayOpt = CRM_Utils_Array
::value('tax_display_settings', $invoiceSettings);
293 $invoicing = CRM_Utils_Array
::value('invoicing', $invoiceSettings);
294 switch ($field->html_type
) {
296 $optionKey = key($customOption);
297 $count = CRM_Utils_Array
::value('count', $customOption[$optionKey], '');
298 $max_value = CRM_Utils_Array
::value('max_value', $customOption[$optionKey], '');
299 $taxAmount = CRM_Utils_Array
::value('tax_amount', $customOption[$optionKey]);
300 if (isset($taxAmount) && $displayOpt && $invoicing) {
301 $qf->assign('displayOpt', $displayOpt);
302 $qf->assign('taxTerm', $taxTerm);
303 $qf->assign('invoicing', $invoicing);
305 $priceVal = implode($seperator, array($customOption[$optionKey][$valueFieldName] +
$taxAmount, $count, $max_value));
308 if (!empty($qf->_quickConfig
) && !empty($qf->_contributionAmount
)) {
309 foreach($fieldOptions as &$fieldOption) {
310 if ($fieldOption['name'] == 'other_amount') {
311 $fieldOption['label'] = $fieldOption['label'] . ' ' . $currencySymbol;
314 $qf->assign('priceset', $elementName);
315 $extra = array('onclick' => 'useAmountOther();');
318 if (!empty($qf->_membershipBlock
) && !empty($qf->_quickConfig
) && $field->name
== 'other_amount' && empty($qf->_contributionAmount
)) {
321 elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label.
322 $label = $fieldOptions[$optionKey]['label'];
325 $element = &$qf->add('text', $elementName, $label,
327 array('price' => json_encode(array($optionKey, $priceVal)),
331 $useRequired && $field->is_required
334 $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4'));
338 if (in_array($optionKey, $feezeOptions)) {
343 if (!empty($qf->_quickConfig
)) {
344 $message = ts('Please enter a valid amount.');
348 $message = ts('%1 must be an integer (whole number).', array(1 => $label));
349 $type = 'positiveInteger';
351 // integers will have numeric rule applied to them.
352 $qf->addRule($elementName, $message, $type);
358 if (!empty($qf->_quickConfig
) && !empty($qf->_contributionAmount
)) {
359 $qf->assign('contriPriceset', $elementName);
362 foreach ($customOption as $opId => $opt) {
363 $taxAmount = CRM_Utils_Array
::value('tax_amount', $opt);
364 if ($field->is_display_amounts
) {
365 $opt['label'] = !empty($opt['label']) ?
$opt['label'] : '';
366 if (isset($taxAmount) && $invoicing) {
367 if ($displayOpt == 'Do_not_show') {
368 $opt['label'] = '<span class="crm-price-amount-amount">' . CRM_Utils_Money
::format($opt[$valueFieldName] +
$taxAmount) . '</span> <span class="crm-price-amount-label">' . $opt['label'] . '</span>';
370 else if ($displayOpt == 'Inclusive') {
371 $opt['label'] = '<span class="crm-price-amount-amount">' . CRM_Utils_Money
::format($opt[$valueFieldName] +
$taxAmount) . '</span> <span class="crm-price-amount-label">' . $opt['label'] . '</span>';
372 $opt['label'] .= '<span class="crm-price-amount-label"> (includes ' . $taxTerm . ' of ' . CRM_Utils_Money
::format($opt['tax_amount']) . ')</span>';
375 $opt['label'] = '<span class="crm-price-amount-amount">' . CRM_Utils_Money
::format($opt[$valueFieldName]) . '</span> <span class="crm-price-amount-label">' . $opt['label'] . '</span>';
376 $opt['label'] .= '<span class="crm-price-amount-label"> + '. CRM_Utils_Money
::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
380 $opt['label'] = '<span class="crm-price-amount-amount">' . CRM_Utils_Money
::format($opt[$valueFieldName]) . '</span> <span class="crm-price-amount-label">' . $opt['label'] . '</span>';
383 $count = CRM_Utils_Array
::value('count', $opt, '');
384 $max_value = CRM_Utils_Array
::value('max_value', $opt, '');
385 $priceVal = implode($seperator, array($opt[$valueFieldName] +
$taxAmount, $count, $max_value));
386 $extra = array('price' => json_encode(array($elementName, $priceVal)),
387 'data-amount' => $opt[$valueFieldName],
388 'data-currency' => $currencyName,
390 if (!empty($qf->_quickConfig
) && $field->name
== 'contribution_amount') {
391 $extra +
= array('onclick' => 'clearAmountOther();');
393 elseif (!empty($qf->_quickConfig
) && $field->name
== 'membership_amount') {
395 'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});",
396 'membership-type' => $opt['membership_type_id'],
398 $qf->assign('membershipFieldID',$field->id
);
401 $choice[$opId] = $qf->createElement('radio', NULL, '', $opt['label'], $opt['id'], $extra);
404 $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4'));
408 if (in_array($opId, $feezeOptions)) {
409 $choice[$opId]->freeze();
412 if (!empty($qf->_membershipBlock
) && $field->name
== 'contribution_amount') {
413 $choice[] = $qf->createElement('radio', NULL, '', ts('No thank you'), '-1',
415 'onclick' => 'clearAmountOther();',
420 if (!$field->is_required
) {
422 if (!empty($otherAmount['is_allow_other_amount']) && $field->name
== 'contribution_amount') {
423 $none = ts('Other Amount');
425 elseif (!empty($qf->_membershipBlock
) && empty($qf->_membershipBlock
['is_required']) && $field->name
== 'membership_amount') {
426 $none = ts('No thank you');
429 $none = ts('- none -');
432 $choice[] = $qf->createElement('radio', NULL, '', $none, '0',
433 array('price' => json_encode(array($elementName, '0')))
437 $element = &$qf->addGroup($choice, $elementName, $label);
439 // make contribution field required for quick config when membership block is enabled
440 if (($field->name
== 'membership_amount' ||
$field->name
== 'contribution_amount')
441 && !empty($qf->_membershipBlock
) && !$field->is_required
) {
442 $useRequired = $field->is_required
= TRUE;
445 if ($useRequired && $field->is_required
) {
446 $qf->addRule($elementName, ts('%1 is a required field.', array(1 => $label)), 'required');
451 $selectOption = $allowedOptions = $priceVal = array();
453 foreach ($customOption as $opt) {
454 $taxAmount = CRM_Utils_Array
::value('tax_amount', $opt);
455 $count = CRM_Utils_Array
::value('count', $opt, '');
456 $max_value = CRM_Utils_Array
::value('max_value', $opt, '');
458 if ($field->is_display_amounts
) {
459 $opt['label'] .= ' - ';
460 if (isset($taxAmount) && $invoicing) {
461 $opt['label'] .= self
::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm);
464 $opt['label'] .= CRM_Utils_Money
::format($opt[$valueFieldName]);
467 $selectOption[$opt['id']] = $opt['label'];
468 $priceVal[$opt['id']] = implode($seperator, array($opt[$valueFieldName] +
$taxAmount, $count, $max_value));
470 if (!in_array($opt['id'], $feezeOptions)) {
471 $allowedOptions[] = $opt['id'];
474 $qf->add( 'text', 'txt-'.$elementName, $label, array( 'size' => '4'));
477 $element = &$qf->add('select', $elementName, $label,
479 '' => ts('- select -')) +
$selectOption,
480 $useRequired && $field->is_required
,
481 array('price' => json_encode($priceVal))
485 $button = substr($qf->controller
->getButtonName(), -4);
486 if (!empty($feezeOptions) && $button != 'skip') {
487 $qf->addRule($elementName, ts('Sorry, this option is currently sold out.'), 'regex', "/" . implode('|', $allowedOptions) . "/");
494 foreach ($customOption as $opId => $opt) {
495 $taxAmount = CRM_Utils_Array
::value('tax_amount', $opt);
496 $count = CRM_Utils_Array
::value('count', $opt, '');
497 $max_value = CRM_Utils_Array
::value('max_value', $opt, '');
499 if ($field->is_display_amounts
) {
500 $opt['label'] .= ' - ';
501 if (isset($taxAmount) && $invoicing) {
502 $opt['label'] .= self
::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm);
505 $opt['label'] .= CRM_Utils_Money
::format($opt[$valueFieldName]);
508 $priceVal = implode($seperator, array($opt[$valueFieldName] +
$taxAmount, $count, $max_value));
509 $check[$opId] = &$qf->createElement('checkbox', $opt['id'], NULL, $opt['label'],
510 array('price' => json_encode(array($opt['id'], $priceVal)),
511 'data-amount' => $opt[$valueFieldName],
512 'data-currency' => $currencyName,
516 $txtcheck[$opId] =& $qf->createElement( 'text', $opId, $opt['label'], array( 'size' => '4' ) );
517 $qf->addGroup($txtcheck, 'txt-'.$elementName, $label);
520 if (in_array($opId, $feezeOptions)) {
521 $check[$opId]->freeze();
524 $element = &$qf->addGroup($check, $elementName, $label);
525 if ($useRequired && $field->is_required
) {
526 $qf->addRule($elementName, ts('%1 is a required field.', array(1 => $label)), 'required');
530 if (isset($qf->_online
) && $qf->_online
) {
536 * Retrieve a list of options for the specified field
538 * @param int $fieldId price field ID
539 * @param bool $inactiveNeeded include inactive options
540 * @param bool $reset ignore stored values\
542 * @return array array of options
544 public static function getOptions($fieldId, $inactiveNeeded = FALSE, $reset = FALSE) {
545 static $options = array();
547 if ($reset ||
empty($options[$fieldId])) {
549 CRM_Price_BAO_PriceFieldValue
::getValues($fieldId, $values, 'weight', !$inactiveNeeded);
550 $options[$fieldId] = $values;
551 $taxRates = CRM_Core_PseudoConstant
::getTaxRates();
553 // ToDo - Code for Hook Invoke
555 foreach ($options[$fieldId] as $priceFieldId => $priceFieldValues) {
556 if (isset($priceFieldValues['financial_type_id']) && array_key_exists($priceFieldValues['financial_type_id'], $taxRates)) {
557 $options[$fieldId][$priceFieldId]['tax_rate'] = $taxRates[$priceFieldValues['financial_type_id']];
558 $taxAmount = CRM_Contribute_BAO_Contribution_Utils
::calculateTaxAmount($priceFieldValues['amount'], $options[$fieldId][$priceFieldId]['tax_rate']);
559 $options[$fieldId][$priceFieldId]['tax_amount'] = round($taxAmount['tax_amount'],2);
564 return $options[$fieldId];
568 * @param $optionLabel
573 public static function getOptionId($optionLabel, $fid) {
574 if (!$optionLabel ||
!$fid) {
578 $optionGroupName = "civicrm_price_field.amount.{$fid}";
582 option_value.id as id
584 civicrm_option_value option_value,
585 civicrm_option_group option_group
587 option_group.name = %1
588 AND option_group.id = option_value.option_group_id
589 AND option_value.label = %2";
591 $dao = CRM_Core_DAO
::executeQuery($query, array(1 => array($optionGroupName, 'String'), 2 => array($optionLabel, 'String')));
593 while ($dao->fetch()) {
599 * Delete the price set field.
601 * @param int $id Field Id
609 public static function deleteField($id) {
610 $field = new CRM_Price_DAO_PriceField();
613 if ($field->find(TRUE)) {
614 // delete the options for this field
615 CRM_Price_BAO_PriceFieldValue
::deleteValues($id);
617 // reorder the weight before delete
618 $fieldValues = array('price_set_id' => $field->price_set_id
);
620 CRM_Utils_Weight
::delWeight('CRM_Price_DAO_PriceField', $field->id
, $fieldValues);
622 // now delete the field
623 return $field->delete();
632 static function &htmlTypes() {
633 static $htmlTypes = NULL;
636 'Text' => ts('Text / Numeric Quantity'),
637 'Select' => ts('Select'),
638 'Radio' => ts('Radio'),
639 'CheckBox' => ts('CheckBox'),
646 * Validate the priceset
648 * @param int $priceSetId , array $fields
650 * retrun the error string
654 * @param bool $allowNoneSelection
660 public static function priceSetValidation($priceSetId, $fields, &$error, $allowNoneSelection = FALSE) {
661 // check for at least one positive
662 // amount price field should be selected.
663 $priceField = new CRM_Price_DAO_PriceField();
664 $priceField->price_set_id
= $priceSetId;
667 $priceFields = array();
669 if ($allowNoneSelection) {
670 $noneSelectedPriceFields = array();
673 while ($priceField->fetch()) {
674 $key = "price_{$priceField->id}";
676 if ($allowNoneSelection) {
677 if (array_key_exists($key, $fields)) {
678 if ($fields[$key] == 0 && !$priceField->is_required
) {
679 $noneSelectedPriceFields[] = $priceField->id
;
684 if (!empty($fields[$key])) {
685 $priceFields[$priceField->id
] = $fields[$key];
689 if (!empty($priceFields)) {
690 // we should has to have positive amount.
693 FROM civicrm_price_field
694 WHERE id IN (" . implode(',', array_keys($priceFields)) . ')';
695 $fieldDAO = CRM_Core_DAO
::executeQuery($sql);
696 $htmlTypes = array();
697 while ($fieldDAO->fetch()) {
698 $htmlTypes[$fieldDAO->id
] = $fieldDAO->html_type
;
701 $selectedAmounts = array();
703 foreach ($htmlTypes as $fieldId => $type) {
705 CRM_Price_BAO_PriceFieldValue
::getValues($fieldId, $options);
707 if (empty($options)) {
711 if ($type == 'Text') {
712 foreach ($options as $opId => $option) {
713 $selectedAmounts[$opId] = $priceFields[$fieldId] * $option['amount'];
717 elseif (is_array($fields["price_{$fieldId}"])) {
718 foreach (array_keys($fields["price_{$fieldId}"]) as $opId) {
719 $selectedAmounts[$opId] = $options[$opId]['amount'];
722 elseif (in_array($fields["price_{$fieldId}"], array_keys($options))) {
723 $selectedAmounts[$fields["price_{$fieldId}"]] = $options[$fields["price_{$fieldId}"]]['amount'];
727 list($componentName) = explode(':', $fields['_qf_default']);
728 // now we have all selected amount in hand.
729 $totalAmount = array_sum($selectedAmounts);
730 if ($totalAmount < 0) {
731 $error['_qf_default'] = ts('%1 amount can not be less than zero. Please select the options accordingly.', array(1 => $componentName));
735 if ($allowNoneSelection) {
736 if (empty($noneSelectedPriceFields)) {
737 $error['_qf_default'] = ts('Please select at least one option from price set.');
740 $error['_qf_default'] = ts('Please select at least one option from price set.');
746 * Generate the label for price fields based on tax display setting option on CiviContribute Component Settings page.
749 * @param string $valueFieldName amount
750 * @param string $displayOpt tax display setting option
752 * @return string $label tax label for custom field
758 public static function getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm) {
759 if ($displayOpt == 'Do_not_show') {
760 $label = CRM_Utils_Money
::format($opt[$valueFieldName] +
$opt['tax_amount']);
762 else if ($displayOpt == 'Inclusive') {
763 $label = CRM_Utils_Money
::format($opt[$valueFieldName] +
$opt['tax_amount']);
764 $label .= '<span class="crm-price-amount-label"> (includes ' . $taxTerm . ' of ' . CRM_Utils_Money
::format($opt['tax_amount']) . ')</span>';
767 $label = CRM_Utils_Money
::format($opt[$valueFieldName]);
768 $label .= '<span class="crm-price-amount-label"> + '. CRM_Utils_Money
::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';