Skip to content

Commit

Permalink
Merged in staging (pull request civicrm#2)
Browse files Browse the repository at this point in the history
Update giftaid extension
  • Loading branch information
vincent1892 committed Aug 2, 2016
2 parents 24f71f0 + 59e25de commit 26ee342
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@ public function __construct() {
)
)
),
'civicrm_contact' =>
array(
'dao' => 'CRM_Contact_DAO_Contact',
'fields' => array(
'prefix_id' => array(
'name' => 'prefix_id',
'title' => 'Title',
'no_display' => FALSE,
'required' => TRUE,
),
'first_name' => array(
'name' => 'first_name',
'title' => 'First Name',
'no_display' => FALSE,
'required' => TRUE,
),
'last_name' => array(
'name' => 'last_name',
'title' => 'Last Name',
'no_display' => FALSE,
'required' => TRUE,
),
),
),
'civicrm_contribution' =>
array(
'dao' => 'CRM_Contribute_DAO_Contribution',
Expand All @@ -83,7 +107,7 @@ public function __construct() {
'name' => 'contact_id',
'title' => 'Donor Name',
'no_display' => FALSE,
'required' => TRUE,
'required' => FALSE,
),
'receive_date' => array(
'name' => 'receive_date',
Expand Down Expand Up @@ -260,6 +284,8 @@ public function from() {
INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
ON {$this->_aliases['civicrm_entity_batch']}.entity_table = 'civicrm_contribution'
AND {$this->_aliases['civicrm_entity_batch']}.entity_id = {$this->_aliases['civicrm_contribution']}.id
INNER JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
ON {$this->_aliases['civicrm_contribution']}.contact_id = {$this->_aliases['civicrm_contact']}.id
INNER JOIN civicrm_line_item {$this->_aliases['civicrm_line_item']}
ON {$this->_aliases['civicrm_contribution']}.id = {$this->_aliases['civicrm_line_item']}.contribution_id
INNER JOIN civicrm_financial_type {$this->_aliases['civicrm_financial_type']}
Expand Down Expand Up @@ -377,6 +403,14 @@ public function alterDisplay(&$rows) {
$entryFound = TRUE;
}

// handle Contact Title
if (array_key_exists('civicrm_contact_prefix_id', $row)) {
if ($value = $row['civicrm_contact_prefix_id']) {
$rows[$rowNum]['civicrm_contact_prefix_id'] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', 'prefix_id', $value);
}
$entryFound = TRUE;
}

// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
Expand Down Expand Up @@ -431,6 +465,9 @@ private function reorderColumns() {
$columnTitleOrder = array(
'payment no',
'line item no',
'title',
'first name',
'last name',
'donor name',
'item',
'description',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function install() {
*
*/
public function uninstall() {
/*
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_group WHERE name = 'giftaid_batch_name'");
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_group WHERE name = 'giftaid_basic_rate_tax'");
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_group WHERE name = 'reason_ended'");
Expand Down Expand Up @@ -100,6 +101,7 @@ public function uninstall() {
'name' => 'Gift_Aid_Declaration')
)),
));
*/

$reportUrl = new CRM_Core_DAO_OptionValue();
$reportUrl->option_group_id = self::getReportTemplateGroupId();;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ These instructions assume that you are only upgrading the Gift Aid module from v

1. If you navigate to the extension list in your install, CiviCRM should display a message stating that a newer version of the Gift Aid extension is available for download.

Alternatively you can download the latest version of the Gift Aid extension from the Compucorp Github below:

[Download Gift Aid from Git](https://github.com/compucorp/uk.co.compucorp.civicrm.giftaid"GiftAid Github")
Alternatively you can download the latest version of the Gift Aid extension from the Compucorp Github: [Download Gift Aid from Git](https://github.com/compucorp/uk.co.compucorp.civicrm.giftaid"GiftAid Github")

2. Once installed you should receive a message bubble indicating that your Gift Aid module code has changed and an upgrade script is required to be run.

Expand All @@ -26,6 +24,13 @@ These instructions assume that you are only upgrading the Gift Aid module from v

2. Click settings and then choose the specific contribution type(s) you want gift aid to be available for i.e “Donation”

3. [3.0] Go to Gift Aid settings page http://www.example.com/civicrm/admin/gift-aid and select the financial types that should be considered as donation or leave it as default to enable Gift Aid for all financial types.

4. [3.0] **[Important]** A new type of Gift Aid declaration is applied to covers both present& future donation and the donations a donor made in the past four years from the declaration date as long as the Gift Aid claim amount does not exceed tax amount. The old 'Yes' declaration is reserved to cover any old declarations donors made. Settings for the declatation options can be modified in the 'UK Taxpayer Options' list here: https://tpg.ccuptest.co.uk/civicrm/admin/options?reset=1

5. [3.0] **[Important]** From Gift Aid 3.0 onwards, a new mechanism is introduced to marking donations from the past 4 years eligible to Gift Aid based on the new declaration type. **Present and future donations will not be affected by this new mechanism.** A scheduled job will be used to handle the 100 past donation records per run. To enable this scheduled job, please go to http://www.example.com/civicrm/admin/job and enable the job 'Process Gift Aid eligible donations'.


###Configure the Gift Aid Profile and disclaimer

You'll need to add a Gift Aid profile to any contribution forms that you want to use to collect "Gift-aid-able" contributions.
Expand All @@ -50,6 +55,9 @@ Having collected contributions with the appropriate Gift Aid profile enabled you

2. The module will indicate which contributions are eligible to be placed in a batch. These are contributions where the donor has a valid Gift Aid declaration at the time of the contribution, a valid UK address with postcode and where the contribution is not already in a batch. A valid UK address with postcode needs to be input by the donor at the point of signing up.

3. You can use the 'Process eligible donations manually' function to process eligiblity of donations instantly if some donations are not yet marked as eligible when adding to batch.


Remove contributions from Gift Aid batch - If you need to remove a contribution from a Gift Aid batch, select the contributions, then select “Remove from gift aid batch” and hit ‘Go’. Then you will see the following information summarised:

* The number of contributions selected.
Expand All @@ -58,7 +66,7 @@ Remove contributions from Gift Aid batch - If you need to remove a contribution

* The number of contributions not yet added to any batch

**Note: contributions submitted to the HMRC cannot be removed from a Batch**
**Note: contributions submitted to the HMRC should not be removed from a batch**

###Submission to HMRC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<author>Erawat Chamanont, Jamie Novick, Guanhuan Chen, Robin Mitra</author>
<email>[email protected], [email protected], [email protected]</email>
</maintainer>
<releaseDate>2015-11-18</releaseDate>
<version>3.0</version>
<releaseDate>2016-06-05</releaseDate>
<version>3.0beta</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.x</ver>
Expand Down

0 comments on commit 26ee342

Please sign in to comment.