From 1a222878f7dfa746b0f985bc8ad6051d75d379af Mon Sep 17 00:00:00 2001 From: Pradeep Nayak <pradeep@pradeep.(none)> Date: Sat, 5 Oct 2013 00:22:41 +0530 Subject: [PATCH] --merged 4.3 to master --- CRM/Grant/Form/GrantProgramView.php | 2 +- CRM/Grant/Form/Task/GrantPayment.php | 4 +--- README.md | 5 ++++- info.xml | 7 ++++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CRM/Grant/Form/GrantProgramView.php b/CRM/Grant/Form/GrantProgramView.php index 6683355..7ca11af 100755 --- a/CRM/Grant/Form/GrantProgramView.php +++ b/CRM/Grant/Form/GrantProgramView.php @@ -207,7 +207,7 @@ class CRM_Grant_Form_GrantProgramView extends CRM_Core_Form { $grantPrograms = CRM_Grant_BAO_GrantProgram::getGrantPrograms(); $eligibleCountMessage = $remainingAmount = NULL; 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) { $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."); diff --git a/CRM/Grant/Form/Task/GrantPayment.php b/CRM/Grant/Form/Task/GrantPayment.php index fca8364..6afa614 100755 --- a/CRM/Grant/Form/Task/GrantPayment.php +++ b/CRM/Grant/Form/Task/GrantPayment.php @@ -162,7 +162,6 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form $this->_approvedGrants = $this->get( 'approvedGrants' ); $grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE); $maxLimit = $grantThresholds['Maximum number of checks per pdf file']; - 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.")"; $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 $details[$dao->id]['currency'] = $dao->currency; $contactGrants[$dao->grant_id] = $dao->id; - $grantAmount[$dao->id] += $dao->total_amount; if ( !$this->_prid ) { $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 $values['payment_number']++; $totalAmount += $details[$id]['total_amount']; } - foreach ( $grantPayment as $grantKey => $grantInfo ) { $row = array(); $grantValues = $grantInfo; @@ -279,6 +276,7 @@ class CRM_Grant_Form_Task_GrantPayment extends CRM_Core_Form $downloadNamePDF .= '.pdf'; $fileName = CRM_Utils_File::makeFileName( $downloadNamePDF ); $files[] = $fileName = CRM_Grant_BAO_GrantPayment::makePDF($fileName, $grantPayment ); + $counter++; } $downloadNameCSV = check_plain('grantPayment'); $downloadNameCSV .= '_'.date('Ymdhis'); diff --git a/README.md b/README.md index ae5472a..eac5a31 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ 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 diff --git a/info.xml b/info.xml index 4a2db9a..f82605b 100644 --- a/info.xml +++ b/info.xml @@ -2,15 +2,16 @@ <extension key="biz.jmaconsulting.grantprograms" type="module"> <file>grantprograms</file> <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> <maintainer> <author>JMA Consulting</author> <email>joe.murray@jmaconsulting.biz</email> </maintainer> <releaseDate>2013-03-13</releaseDate> - <version>1.0.beta2</version> - <develStage>beta</develStage> + <version>1.0</version> <compatibility> <ver>4.3</ver> </compatibility> -- GitLab