From ae3a9643e62f1fd7ffa7874116dfb1548bbbf486 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 20 Sep 2016 16:18:37 +0530 Subject: [PATCH] CRM-16189, changed function defination ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 --- CRM/Price/BAO/LineItem.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 0d0d6ad520..e721e3abe3 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -162,18 +162,16 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { } /** - * @param int $entityId - * @param $entityTable + * @param int $contributionId * * @return null|string */ - public static function getLineTotal($entityId, $entityTable) { + public static function getLineTotal($contributionId) { $sqlLineItemTotal = "SELECT SUM(li.line_total + COALESCE(li.tax_amount,0)) FROM civicrm_line_item li -WHERE li.entity_table = '{$entityTable}' -AND li.entity_id = {$entityId} -"; - $lineItemTotal = CRM_Core_DAO::singleValueQuery($sqlLineItemTotal); +WHERE li.contribution_id = %1"; + $params = array(1 => array($contributionId, 'Integer')); + $lineItemTotal = CRM_Core_DAO::singleValueQuery($sqlLineItemTotal, $params); return $lineItemTotal; } -- 2.25.1