Commit 469da524 authored by Monish Deb's avatar Monish Deb

AGBU-16: remove overriden files

parent 5fdd363b
This diff is collapsed.
...@@ -122,4 +122,141 @@ function from($name, $mode, $side) { ...@@ -122,4 +122,141 @@ function from($name, $mode, $side) {
public static function getPanesMapper(&$panes) { public static function getPanesMapper(&$panes) {
} }
/**
* Function to retrieve financial items assigned for a batch
*
* @param int $entityID
* @param array $returnValues
* @param null $notPresent
* @param null $params
* @return Object
*/
static function getBatchFinancialItems($entityID, $returnValues, $notPresent = NULL, $params = NULL, $getCount = FALSE) {
if (!$getCount) {
if (!empty($params['rowCount']) &&
$params['rowCount'] > 0
) {
$limit = " LIMIT {$params['offset']}, {$params['rowCount']} ";
}
}
// action is taken depending upon the mode
$select = 'civicrm_financial_trxn.id ';
if (!empty( $returnValues)) {
$select .= " , ".implode(' , ', $returnValues);
}
$orderBy = " ORDER BY civicrm_financial_trxn.id";
if (!empty($params['sort'])) {
$orderBy = ' ORDER BY ' . CRM_Utils_Type::escape($params['sort'], 'String');
}
$from = "civicrm_financial_trxn
LEFT JOIN civicrm_entity_financial_trxn ON civicrm_entity_financial_trxn.financial_trxn_id = civicrm_financial_trxn.id
LEFT JOIN civicrm_entity_batch ON civicrm_entity_batch.entity_id = civicrm_financial_trxn.id
LEFT OUTER JOIN civicrm_contribution ON civicrm_contribution.id = civicrm_entity_financial_trxn.entity_id AND civicrm_entity_financial_trxn.entity_table = 'civicrm_contribution'
LEFT OUTER JOIN civicrm_grant ON civicrm_grant.id = civicrm_entity_financial_trxn.entity_id AND civicrm_entity_financial_trxn.entity_table = 'civicrm_grant'
LEFT JOIN civicrm_financial_type ON civicrm_financial_type.id = IFNULL(civicrm_contribution.financial_type_id, civicrm_grant.financial_type_id)
LEFT JOIN civicrm_contact contact_a ON contact_a.id = IFNULL(civicrm_contribution.contact_id, civicrm_grant.contact_id)
LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id = civicrm_contribution.id
";
$searchFields =
array(
'sort_name',
'financial_type_id',
'contribution_page_id',
'contribution_payment_instrument_id',
'contribution_transaction_id',
'contribution_source',
'contribution_currency_type',
'contribution_pay_later',
'contribution_recurring',
'contribution_test',
'contribution_thankyou_date_is_not_null',
'contribution_receipt_date_is_not_null',
'contribution_pcp_made_through_id',
'contribution_pcp_display_in_roll',
'contribution_date_relative',
'contribution_amount_low',
'contribution_amount_high',
'contribution_in_honor_of',
'contact_tags',
'group',
'contribution_date_relative',
'contribution_date_high',
'contribution_date_low',
'contribution_check_number',
'contribution_status_id',
);
$values = array();
foreach ($searchFields as $field) {
if (isset($params[$field])) {
$values[$field] = $params[$field];
if ($field == 'sort_name') {
$from .= " LEFT JOIN civicrm_contact contact_b ON contact_b.id = civicrm_contribution.contact_id
LEFT JOIN civicrm_email ON contact_b.id = civicrm_email.contact_id";
}
if ($field == 'contribution_in_honor_of') {
$from .= " LEFT JOIN civicrm_contact contact_b ON contact_b.id = civicrm_contribution.contact_id";
}
if ($field == 'contact_tags') {
$from .= " LEFT JOIN civicrm_entity_tag `civicrm_entity_tag-{$params[$field]}` ON `civicrm_entity_tag-{$params[$field]}`.entity_id = contact_a.id";
}
if ($field == 'group') {
$from .= " LEFT JOIN civicrm_group_contact `civicrm_group_contact-{$params[$field]}` ON contact_a.id = `civicrm_group_contact-{$params[$field]}`.contact_id ";
}
if ($field == 'contribution_date_relative') {
$relativeDate = explode('.', $params[$field]);
$date = CRM_Utils_Date::relativeToAbsolute($relativeDate[0], $relativeDate[1]);
$values['contribution_date_low'] = $date['from'];
$values['contribution_date_high'] = $date['to'];
}
$searchParams = CRM_Contact_BAO_Query::convertFormValues($values);
$query = new CRM_Contact_BAO_Query($searchParams,
CRM_Contribute_BAO_Query::defaultReturnProperties(CRM_Contact_BAO_Query::MODE_CONTRIBUTE,
FALSE
),NULL, FALSE, FALSE,CRM_Contact_BAO_Query::MODE_CONTRIBUTE
);
if ($field == 'contribution_date_high' || $field == 'contribution_date_low') {
$query->dateQueryBuilder($params[$field], 'civicrm_contribution', 'contribution_date', 'receive_date', 'Contribution Date');
}
}
}
if (!empty($query->_where[0])) {
$where = implode(' AND ', $query->_where[0]) .
" AND civicrm_entity_batch.batch_id IS NULL
AND (civicrm_grant.id IS NOT NULL OR civicrm_contribution.id IS NOT NULL)";
$searchValue = TRUE;
}
else {
$searchValue = FALSE;
}
if (!$searchValue) {
if (!$notPresent) {
$where = " ( civicrm_entity_batch.batch_id = {$entityID}
AND civicrm_entity_batch.entity_table = 'civicrm_financial_trxn'
AND (civicrm_grant.id IS NOT NULL OR civicrm_contribution.id IS NOT NULL) )";
}
else {
$where = " ( civicrm_entity_batch.batch_id IS NULL
AND (civicrm_grant.id IS NOT NULL OR civicrm_contribution.id IS NOT NULL) )";
}
}
$sql = "
SELECT {$select}
FROM {$from}
WHERE {$where}
{$orderBy}
";
if (isset($limit)) {
$sql .= "{$limit}";
}
$result = CRM_Core_DAO::executeQuery($sql);
return $result;
}
} }
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<access_arguments>edit grant program</access_arguments> <access_arguments>edit grant program</access_arguments>
<page_type>1</page_type> <page_type>1</page_type>
<weight>1011</weight> <weight>1011</weight>
</item> </item>
<item> <item>
<path>civicrm/grant/payment</path> <path>civicrm/grant/payment</path>
<title>Grant Payment</title> <title>Grant Payment</title>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<access_arguments>access CiviGrant</access_arguments> <access_arguments>access CiviGrant</access_arguments>
<page_type>1</page_type> <page_type>1</page_type>
<component>CiviGrant</component> <component>CiviGrant</component>
</item> </item>
<item> <item>
<path>civicrm/grant/payment/reprint</path> <path>civicrm/grant/payment/reprint</path>
<title>Grant Payment Reprint</title> <title>Grant Payment Reprint</title>
...@@ -31,25 +31,30 @@ ...@@ -31,25 +31,30 @@
<path_arguments>action=add</path_arguments> <path_arguments>action=add</path_arguments>
<page_callback>CRM_Grant_Form_Task_GrantPayment</page_callback> <page_callback>CRM_Grant_Form_Task_GrantPayment</page_callback>
<access_arguments>access CiviGrant</access_arguments> <access_arguments>access CiviGrant</access_arguments>
</item> </item>
<item> <item>
<path>civicrm/grant_program/allocate</path> <path>civicrm/grant_program/allocate</path>
<page_callback>CRM_Grant_Form_GrantProgramView::allocate</page_callback> <page_callback>CRM_Grant_Form_GrantProgramView::allocate</page_callback>
<access_arguments>access CiviCRM</access_arguments> <access_arguments>access CiviCRM</access_arguments>
</item> </item>
<item> <item>
<path>civicrm/grant_program/finalize</path> <path>civicrm/grant_program/finalize</path>
<page_callback>CRM_Grant_Form_GrantProgramView::finalize</page_callback> <page_callback>CRM_Grant_Form_GrantProgramView::finalize</page_callback>
<access_arguments>access CiviCRM</access_arguments> <access_arguments>access CiviCRM</access_arguments>
</item> </item>
<item> <item>
<path>civicrm/grant_program/reject</path> <path>civicrm/grant_program/reject</path>
<page_callback>CRM_Grant_Form_GrantProgramView::reject</page_callback> <page_callback>CRM_Grant_Form_GrantProgramView::reject</page_callback>
<access_arguments>access CiviCRM</access_arguments> <access_arguments>access CiviCRM</access_arguments>
</item> </item>
<item> <item>
<path>civicrm/grant_program/processFinalization</path> <path>civicrm/grant_program/processFinalization</path>
<page_callback>CRM_Grant_Form_GrantProgramView::processFinalization</page_callback> <page_callback>CRM_Grant_Form_GrantProgramView::processFinalization</page_callback>
<access_arguments>access CiviCRM</access_arguments> <access_arguments>access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/getfinancialtransaction</path>
<page_callback>CRM_Grantprograms_AJAX::getFinancialTransactionsList</page_callback>
<access_arguments>access CiviCRM</access_arguments>
</item> </item>
</menu> </menu>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment