CRM-19583 show financial type of line items whenbackoffice users view them
authoreileenmcnaugton <eileen@fuzion.co.nz>
Sun, 30 Oct 2016 23:03:06 +0000 (12:03 +1300)
committereileenmcnaugton <eileen@fuzion.co.nz>
Sun, 30 Oct 2016 23:19:12 +0000 (12:19 +1300)
CRM/Contribute/Form/ContributionView.php
CRM/Price/BAO/LineItem.php
templates/CRM/Price/Page/LineItem.tpl

index 2f001debd8089d677f08cbb91aaf14c43010e226..78ac04e1dc5f192c52552ad7f153445eb304a97e 100644 (file)
@@ -160,6 +160,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
     }
     $this->assign('lineItem', empty($lineItems) ? FALSE : $lineItems);
     $values['totalAmount'] = $values['total_amount'];
+    $this->assign('displayLineItemFinancialType', TRUE);
 
     //do check for campaigns
     if ($campaignId = CRM_Utils_Array::value('campaign_id', $values)) {
index 586fbd68d6edef523ce83dabbe0152c038b8f862..0511af4b10cf703e572d9480bffef024b9fbcae8 100644 (file)
@@ -295,6 +295,7 @@ AND li.entity_id = {$entityId}
         'entity_table' => $dao->entity_table,
         'contribution_id' => $dao->contribution_id,
         'financial_type_id' => $dao->financial_type_id,
+        'financial_type' => CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'financial_type_id', $dao->financial_type_id),
         'membership_type_id' => $dao->membership_type_id,
         'membership_num_terms' => $dao->membership_num_terms,
         'tax_amount' => $dao->tax_amount,
index c61c50e261b9e13f6fe46173e9bb6a69927912d0..2d0807a0df0bdec9819ce073e3aa78c2933cdc14 100644 (file)
@@ -36,6 +36,9 @@
     <table>
       <tr class="columnheader">
         <th>{ts}Item{/ts}</th>
+        {if $displayLineItemFinancialType}
+          <th>{ts}Financial Type{/ts}</th>
+        {/if}
         {if $context EQ "Membership"}
           <th class="right">{ts}Fee{/ts}</th>
         {else}
@@ -60,6 +63,9 @@
       {foreach from=$value item=line}
         <tr{if $line.qty EQ 0} class="cancelled"{/if}>
           <td>{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div class="description">{$line.description}</div>{/if}</td>
+          {if $displayLineItemFinancialType}
+            <td>{$line.financial_type}</td>
+          {/if}
           {if $context NEQ "Membership"}
             <td class="right">{$line.qty}</td>
             <td class="right">{$line.unit_price|crmMoney}</td>