public function RenderAmount(StewardshipContribution $objStewardshipContribution) { if ($this->dtgContributions->CurrentRowIndex == 0) { $this->fltTotal = 0; } if (!$objStewardshipContribution->Id) { return QApplication::DisplayCurrency($this->fltTotal); } // We need to look at a specific fund? if ($this->lstFund->SelectedValue) { $fltAmount = 0; foreach ($objStewardshipContribution->GetStewardshipContributionAmountArray() as $objAmount) { if ($objAmount->StewardshipFundId == $this->lstFund->SelectedValue && $objAmount->StewardshipContributionId == $objStewardshipContribution->Id) { $fltAmount = $objAmount->Amount; // Don't display the total. Just the specific ID amount } } } else { $fltAmount = $objStewardshipContribution->TotalAmount; } $this->fltTotal += $fltAmount; return sprintf('<a href="/stewardship/batch.php/%s#%s/view_contribution/%s">%s</a>', $objStewardshipContribution->StewardshipBatchId, $objStewardshipContribution->StewardshipStack->StackNumber, $objStewardshipContribution->Id, $this->FormatNumber($fltAmount)); }