Commit 12aa8918 authored by Monish Deb's avatar Monish Deb
Browse files

QA fixes

parent 3027ff7c
......@@ -23,6 +23,7 @@ class CRM_Syncintacct_Util {
public static function fetchEntries($batchID, $entityType) {
$entityTable = ($entityType == 'GL') ? 'civicrm_contribution' : 'civicrm_grant';
$amountColumn = ($entityType == 'GL') ? 'total_amount' : 'amount_total';
$sql = "SELECT as financial_trxn_id,
......@@ -34,14 +35,12 @@ class CRM_Syncintacct_Util {
ft.trxn_id AS trxn_id,
cov.label AS payment_instrument,
c.source AS source, AS contribution_id,
c.total_amount AS contribution_amount,
c.{$amountColumn} AS contribution_amount,
c.contact_id AS contact_id,
eb.batch_id AS batch_id,
ft.currency AS currency,
cov_status.label AS status,
WHEN efti.entity_id IS NOT NULL
THEN efti.amount
......@@ -65,10 +64,8 @@ class CRM_Syncintacct_Util {
LEFT JOIN civicrm_option_group cog ON = 'payment_instrument'
LEFT JOIN civicrm_option_value cov ON (cov.value = ft.payment_instrument_id AND cov.option_group_id =
LEFT JOIN civicrm_entity_financial_trxn eftc ON (eftc.financial_trxn_id = AND eftc.entity_table = '{$entityTable}')
LEFT JOIN civicrm_contribution c ON = eftc.entity_id
LEFT JOIN {$entityTable} c ON = eftc.entity_id
LEFT JOIN civicrm_contact cc ON = c.contact_id
LEFT JOIN civicrm_option_group cog_status ON = 'contribution_status'
LEFT JOIN civicrm_option_value cov_status ON (cov_status.value = ft.status_id AND cov_status.option_group_id =
LEFT JOIN civicrm_entity_financial_trxn efti ON (efti.financial_trxn_id = AND efti.entity_table = 'civicrm_financial_item')
LEFT JOIN civicrm_financial_item fi ON = efti.entity_id
LEFT JOIN civicrm_financial_account fac ON = fi.financial_account_id
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