retrieve LineItems by contributionID regardless of component
authorAndrei Mondoc <andreimondoc@gmail.com>
Wed, 16 Jan 2019 21:35:40 +0000 (21:35 +0000)
committerAndrei Mondoc <andreimondoc@gmail.com>
Fri, 28 Jun 2019 00:35:17 +0000 (01:35 +0100)
CRM/Contribute/Form/Task/Invoice.php

index a38c5e93274c06302f615ff77a7f1893ed4566e4..55447fd77a6ba59ff7dd7ac8c9d7e370d16ab14e 100644 (file)
@@ -301,13 +301,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
       $invoiceDate = date("F j, Y");
       $dueDate = date('F j, Y', strtotime($contributionReceiveDate . "+" . $prefixValue['due_date'] . "" . $prefixValue['due_date_period']));
 
-      if ($input['component'] == 'contribute') {
-        $lineItem = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contribID);
-      }
-      else {
-        $eid = $contribution->_relatedObjects['participant']->id;
-        $lineItem = CRM_Price_BAO_LineItem::getLineItems($eid, 'participant', NULL, TRUE, FALSE, TRUE);
-      }
+      $lineItem = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contribID);
 
       $resultPayments = civicrm_api3('Payment', 'get', [
         'sequential' => 1,