Details
-
Type:
Improvement
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.0.8
-
Fix Version/s: 4.2.2
-
Component/s: Accounting Integration, CiviContribute, CiviReport
-
Labels:None
Description
I have started on a report to expose better contribution data regarding price sets. I'm posting code in it's current state as a patch so I can share / discuss but is still under review.
As part of this I would like to look at moving the approach I have been using to customise reports into Form.php. I have been creating small 'building block' functions & adding them to the reports as appropriate.
Thus the entire class for my report that
- reports on contributions &
- allows them to be totalled with the option of grouping by line-item values and contribution types
looks like this.
$this->addToLineItemFromContribution(); is a complicated join taking into account the 3 ways the tables can be connected but the function would sit in Form.php & be available to any report functions as appropriate & can be changed in one place when CiviAccounts is implemented
class CRM_Report_Form_Price_Contributionbased extends CRM_Report_Form {
protected $_baseTable = 'civicrm_contribution' ;
function __construct( )
{ $this->_columns = $this->getContactColumns() + $this->getLineItemColumns() + $this->getContributionColumns() ; parent::__construct(); }function fromClauses( )
{ return array( 'lineItem_from_contribution', 'contact_from_contribution', ); }}
***NOTE that avaliable from clauses now defined on extended class in function getAvailableJoins()
I wanted the from function to be able to build the joins so that the human error of remembering the ACL clause would be removed as it was inconsistent
Attachments
Issue Links
- is blocked by
-
CRM-10671 Remove incomplete price set reports from 4.2 distribution
-
- Done/Fixed
-