$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.");
$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($grantPaymentas$grantKey=>$grantInfo){
foreach($grantPaymentas$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
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.
<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>