$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ // Make a copy of line items array to use for display only
+ $tplLineItems = $this->_lineItem;
if ($invoicing) {
$getTaxDetails = FALSE;
$taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
foreach ($this->_lineItem as $key => $value) {
- foreach ($value as $v) {
+ foreach ($value as $k => $v) {
if (isset($v['tax_rate'])) {
if ($v['tax_rate'] != '') {
$getTaxDetails = TRUE;
+ // Cast to float to display without trailing zero decimals
+ $tplLineItems[$key][$k]['tax_rate'] = (float) $v['tax_rate'];
}
}
}
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign('is_separate_payment', $this->_separateMembershipPayment);
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
- $this->assign('lineItem', $this->_lineItem);
+ $this->assign('lineItem', $tplLineItems);
}
else {
$this->assign('is_quick_config', 1);
if ($productID) {
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, $productID, $option);
}
- if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
- $this->assign('lineItem', $this->_lineItem);
- }
- else {
- if (is_array($membershipTypeID)) {
- $membershipTypeID = current($membershipTypeID);
- }
- $this->assign('is_quick_config', 1);
- $this->_params['is_quick_config'] = 1;
- }
- $this->assign('priceSetID', $this->_priceSetId);
- $this->assign('useForMember', $this->get('useForMember'));
$params = $this->_params;
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ // Make a copy of line items array to use for display only
+ $tplLineItems = $this->_lineItem;
if ($invoicing) {
$getTaxDetails = FALSE;
$taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
- foreach ($this->_lineItem as $value) {
- foreach ($value as $v) {
+ foreach ($this->_lineItem as $key => $value) {
+ foreach ($value as $k => $v) {
if (isset($v['tax_rate'])) {
if ($v['tax_rate'] != '') {
$getTaxDetails = TRUE;
+ // Cast to float to display without trailing zero decimals
+ $tplLineItems[$key][$k]['tax_rate'] = (float) $v['tax_rate'];
}
}
}
$this->assign('taxTerm', $taxTerm);
$this->assign('totalTaxAmount', $params['tax_amount']);
}
+
+ if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
+ $this->assign('lineItem', $tplLineItems);
+ }
+ else {
+ if (is_array($membershipTypeID)) {
+ $membershipTypeID = current($membershipTypeID);
+ }
+ $this->assign('is_quick_config', 1);
+ $this->_params['is_quick_config'] = 1;
+ }
+ $this->assign('priceSetID', $this->_priceSetId);
+ $this->assign('useForMember', $this->get('useForMember'));
+
if (!empty($this->_values['honoree_profile_id']) && !empty($params['soft_credit_type_id'])) {
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);