Skip to content
Snippets Groups Projects
Commit 1a222878 authored by Pradeep Nayak's avatar Pradeep Nayak
Browse files

--merged 4.3 to master

parent a1315027
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ class CRM_Grant_Form_GrantProgramView extends CRM_Core_Form { ...@@ -207,7 +207,7 @@ class CRM_Grant_Form_GrantProgramView extends CRM_Core_Form {
$grantPrograms = CRM_Grant_BAO_GrantProgram::getGrantPrograms(); $grantPrograms = CRM_Grant_BAO_GrantProgram::getGrantPrograms();
$eligibleCountMessage = $remainingAmount = NULL; $eligibleCountMessage = $remainingAmount = NULL;
if ($nonEligibleCount) { if ($nonEligibleCount) {
$nonEligibleCountMessage = ts($nonEligibleCount." eligible applications were not allocated since they have already received their annual maximum.";) $nonEligibleCountMessage = ts($nonEligibleCount." eligible applications were not allocated since they have already received their annual maximum.");
} }
if ($eligibleCount) { if ($eligibleCount) {
$eligibleCountMessage = ts($eligibleCount." eligible applications were not allocated ".CRM_Utils_Money::format($eligibleAmount,NULL, NULL,FALSE)." in funds they would have received were funds available."); $eligibleCountMessage = ts($eligibleCount." eligible applications were not allocated ".CRM_Utils_Money::format($eligibleAmount,NULL, NULL,FALSE)." in funds they would have received were funds available.");
......
...@@ -162,7 +162,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form ...@@ -162,7 +162,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form
$this->_approvedGrants = $this->get( 'approvedGrants' ); $this->_approvedGrants = $this->get( 'approvedGrants' );
$grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE); $grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE);
$maxLimit = $grantThresholds['Maximum number of checks per pdf file']; $maxLimit = $grantThresholds['Maximum number of checks per pdf file'];
if ( $this->_prid ) { if ( $this->_prid ) {
$query = "SELECT cp.id as pid, cg.amount_granted as total_amount, cp.currency, cp.payment_reason, cp.contact_id as id, cep.entity_id as grant_id FROM civicrm_payment as cp LEFT JOIN civicrm_entity_payment as cep ON cep.payment_id = cp.id LEFT JOIN civicrm_grant as cg ON cg.id = cep.entity_id WHERE cp.id IN (".$this->_prid.")"; $query = "SELECT cp.id as pid, cg.amount_granted as total_amount, cp.currency, cp.payment_reason, cp.contact_id as id, cep.entity_id as grant_id FROM civicrm_payment as cp LEFT JOIN civicrm_entity_payment as cep ON cep.payment_id = cp.id LEFT JOIN civicrm_grant as cg ON cg.id = cep.entity_id WHERE cp.id IN (".$this->_prid.")";
$countQuery = "SELECT COUNT(cp.id) as ids FROM civicrm_payment as cp LEFT JOIN civicrm_entity_payment as cep ON cep.payment_id = cp.id LEFT JOIN civicrm_grant as cg ON cg.id = cep.entity_id WHERE cp.id IN (".$this->_prid.")"; $countQuery = "SELECT COUNT(cp.id) as ids FROM civicrm_payment as cp LEFT JOIN civicrm_entity_payment as cep ON cep.payment_id = cp.id LEFT JOIN civicrm_grant as cg ON cg.id = cep.entity_id WHERE cp.id IN (".$this->_prid.")";
...@@ -202,7 +201,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form ...@@ -202,7 +201,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form
$details[$dao->id]['currency'] = $dao->currency; $details[$dao->id]['currency'] = $dao->currency;
$contactGrants[$dao->grant_id] = $dao->id; $contactGrants[$dao->grant_id] = $dao->id;
$grantAmount[$dao->id] += $dao->total_amount; $grantAmount[$dao->id] += $dao->total_amount;
if ( !$this->_prid ) { if ( !$this->_prid ) {
$grantProgramSql = "SELECT is_auto_email FROM civicrm_grant_program WHERE id = ".$dao->grant_program_id; $grantProgramSql = "SELECT is_auto_email FROM civicrm_grant_program WHERE id = ".$dao->grant_program_id;
...@@ -246,7 +244,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form ...@@ -246,7 +244,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form
$values['payment_number']++; $values['payment_number']++;
$totalAmount += $details[$id]['total_amount']; $totalAmount += $details[$id]['total_amount'];
} }
foreach ( $grantPayment as $grantKey => $grantInfo ) { foreach ( $grantPayment as $grantKey => $grantInfo ) {
$row = array(); $row = array();
$grantValues = $grantInfo; $grantValues = $grantInfo;
...@@ -279,6 +276,7 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form ...@@ -279,6 +276,7 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form
$downloadNamePDF .= '.pdf'; $downloadNamePDF .= '.pdf';
$fileName = CRM_Utils_File::makeFileName( $downloadNamePDF ); $fileName = CRM_Utils_File::makeFileName( $downloadNamePDF );
$files[] = $fileName = CRM_Grant_BAO_GrantPayment::makePDF($fileName, $grantPayment ); $files[] = $fileName = CRM_Grant_BAO_GrantPayment::makePDF($fileName, $grantPayment );
$counter++;
} }
$downloadNameCSV = check_plain('grantPayment'); $downloadNameCSV = check_plain('grantPayment');
$downloadNameCSV .= '_'.date('Ymdhis'); $downloadNameCSV .= '_'.date('Ymdhis');
......
biz.jmaconsulting.grantprograms biz.jmaconsulting.grantprograms
=============================== ===============================
\ No newline at end of file Important Note: Generating PDF checks results in a string of PHP notices related to DomPDF. To fix this, we need to manually download and extract a missing font library that is not shipped with DomPDF. Download the fonts from here: https://github.com/dompdf/dompdf
Extract the fonts folder into civicrm/packages/dompdf/lib/fonts.
\ No newline at end of file
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
<extension key="biz.jmaconsulting.grantprograms" type="module"> <extension key="biz.jmaconsulting.grantprograms" type="module">
<file>grantprograms</file> <file>grantprograms</file>
<name>GrantProgram</name> <name>GrantProgram</name>
<description>GrantProgram</description> <description>Applications will be received via CiviGrants functionality. Administrators will have to set an assessment score which will decide the amount to be granted for each grant submitted by the applicant.
Amount to be granted will be decided based on the remainder amount present in each grant program for that year and by an algorithm that does a trial, and ultimately a final allocation.
Grants which have been allocated and approved for payment can be selected and paid. Checks will be printed for paid grants and PDF/CSV reports will be generated for the same.</description>
<license>AGPL-3.0</license> <license>AGPL-3.0</license>
<maintainer> <maintainer>
<author>JMA Consulting</author> <author>JMA Consulting</author>
<email>joe.murray@jmaconsulting.biz</email> <email>joe.murray@jmaconsulting.biz</email>
</maintainer> </maintainer>
<releaseDate>2013-03-13</releaseDate> <releaseDate>2013-03-13</releaseDate>
<version>1.0.beta2</version> <version>1.0</version>
<develStage>beta</develStage>
<compatibility> <compatibility>
<ver>4.3</ver> <ver>4.3</ver>
</compatibility> </compatibility>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment