Skip to content
Snippets Groups Projects
Unverified Commit 4a00ebd1 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #16626 from pradpnayak/lineItemFixes

Fixed DB Error: syntax error if line item refers to civicrm_case
parents 87dacc52 810e5923
Branches
Tags
No related merge requests found
......@@ -186,8 +186,8 @@ WHERE li.contribution_id = %1";
*/
public static function getLineItems($entityId, $entity = 'participant', $isQuick = FALSE, $isQtyZero = TRUE, $relatedEntity = FALSE) {
$whereClause = $fromClause = NULL;
$selectClause = "
SELECT li.id,
$selectClause = '
SELECT li.id,
li.label,
li.contribution_id,
li.qty,
......@@ -205,19 +205,19 @@ WHERE li.contribution_id = %1";
li.price_field_value_id,
li.financial_type_id,
li.tax_amount,
pfv.description";
pfv.description';
$condition = "li.entity_id = %2.id AND li.entity_table = 'civicrm_%2'";
$condition = "li.entity_id = civicrm_%2.id AND li.entity_table = 'civicrm_%2'";
if ($relatedEntity) {
$condition = "li.contribution_id = %2.id ";
$condition = 'li.contribution_id = civicrm_%2.id ';
}
$fromClause = "
FROM civicrm_%2 as %2
FROM civicrm_%2
LEFT JOIN civicrm_line_item li ON ({$condition})
LEFT JOIN civicrm_price_field_value pfv ON ( pfv.id = li.price_field_value_id )
LEFT JOIN civicrm_price_field_value pfv ON (pfv.id = li.price_field_value_id)
LEFT JOIN civicrm_price_field pf ON (pf.id = li.price_field_id )";
$whereClause = " WHERE %2.id = %1";
$whereClause = " WHERE civicrm_%2.id = %1";
$orderByClause = " ORDER BY pf.weight, pfv.weight";
if ($isQuick) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment