本文整理汇总了PHP中QQN::StewardshipContributionAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::StewardshipContributionAmount方法的具体用法?PHP QQN::StewardshipContributionAmount怎么用?PHP QQN::StewardshipContributionAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQN
的用法示例。
在下文中一共展示了QQN::StewardshipContributionAmount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Refresh
/**
* Refreshes pledge infromation (e.g. amount contributed, status, etc.)
* @param boolean $blnSave whether or not to save
*/
public function Refresh($blnSave = true)
{
$objAmountArray = StewardshipContributionAmount::QueryArray(QQ::AndCondition(QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipFundId, $this->StewardshipFundId), QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipContribution->PersonId, $this->PersonId)));
$fltTotal = 0;
foreach ($objAmountArray as $objAmount) {
$fltTotal += $objAmount->Amount;
}
$this->fltContributedAmount = $fltTotal;
$this->fltRemainingAmount = max(0, $this->fltPledgeAmount - $this->fltContributedAmount);
$this->blnFulfilledFlag = $this->fltRemainingAmount < 1.0;
if ($this->blnFulfilledFlag) {
$this->blnActiveFlag = false;
}
if ($blnSave) {
$this->Save();
}
}
示例2: CountByStewardshipFundId
/**
* Count StewardshipContributionAmounts
* by StewardshipFundId Index(es)
* @param integer $intStewardshipFundId
* @return int
*/
public static function CountByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null)
{
// Call StewardshipContributionAmount::QueryCount to perform the CountByStewardshipFundId query
return StewardshipContributionAmount::QueryCount(QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipFundId, $intStewardshipFundId), $objOptionalClauses);
}
示例3: SetupPanel
protected function SetupPanel()
{
// /stewardship/batch.php/950#1/edit_contribution/UrlHash/UrlHash2/UrlHash3
// 950 = BatchId
// #1 = StackNumber
// UrlHash can be "New" for new manual entry, an Id # for a ContributionId, or 0 for "Check" entyr
// UrlHash2 must be the check hash (if applicable)
// Urlhash3 is a PersonId to automagically select
$this->blnScanFlag = false;
// Creating New?
if ($this->strUrlHashArgument == 'new') {
// Creating New... Again?
if ($this->strUrlHashArgument2 == 'again') {
return $this->ReturnTo(sprintf('#%s/edit_contribution/new', $this->objStack->StackNumber));
}
$objContribution = new StewardshipContribution();
$objContribution->StewardshipBatch = $this->objBatch;
$objContribution->StewardshipStack = $this->objStack;
$objContribution->DateEntered = QDateTime::Now();
$objContribution->CreatedByLogin = QApplication::$Login;
$objContribution->UnpostedFlag = true;
$objContribution->DateCredited = new QDateTime($this->objBatch->DateCredited);
$objContribution->StewardshipContributionTypeId = StewardshipContributionType::Cash;
// Editing an existing
} else {
if ($this->strUrlHashArgument) {
$objContribution = StewardshipContribution::Load($this->strUrlHashArgument);
if (!$objContribution || $objContribution->StewardshipStackId != $this->objStack->Id || $objContribution->StewardshipBatchId != $this->objBatch->Id) {
$this->ReturnTo('#' . $this->objStack->StackNumber);
}
// Scanning?
} else {
if ($this->strUrlHashArgument2) {
$objContribution = StewardshipContribution::CreateFromCheckImage(QApplication::$Login, $this->objStack, $this->strUrlHashArgument2);
$this->blnScanFlag = true;
$this->imgCheckImage = new TiffImageControl($this);
$this->imgCheckImage->ImagePath = $objContribution->TempPath;
$this->imgCheckImage->Width = '390';
// Error -- go back
} else {
$this->ReturnTo('#' . $this->objStack->StackNumber);
}
}
}
// Auto-set a new person (if specified)
if ($objPerson = Person::Load($this->strUrlHashArgument3)) {
$objContribution->Person = $objPerson;
}
// Setup Fields
$this->mctContribution = new StewardshipContributionMetaControl($this, $objContribution);
$this->chkNonDeductibleFlag = $this->mctContribution->chkNonDeductibleFlag_Create();
$this->chkNonDeductibleFlag->Name = 'Non-Deductibile?';
$this->chkNonDeductibleFlag->Text = 'Check if contribution is <strong>NOT</strong> deductible';
$this->chkNonDeductibleFlag->HtmlEntities = false;
if (!$this->blnScanFlag) {
$this->lstStewardshipContributionType = $this->mctContribution->lstStewardshipContributionType_Create();
$this->lstStewardshipContributionType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstStewardshipContributionType_Change'));
$this->txtAuthorization = $this->mctContribution->txtAuthorizationNumber_Create();
$this->txtCheckNumber = $this->mctContribution->txtCheckNumber_Create();
$this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->txtAlternateSource = $this->mctContribution->txtAlternateSource_Create();
$this->lstStewardshipContributionType_Change();
} else {
// If we're scanning, then make sure we allow selecti onof Check or ReturnedCheck
$this->lstStewardshipContributionType = $this->mctContribution->lstStewardshipContributionType_Create();
$intIndex = 0;
while ($intIndex < count($this->lstStewardshipContributionType->GetAllItems())) {
$objListItem = $this->lstStewardshipContributionType->GetItem($intIndex);
if ($objListItem->Value == StewardshipContributionType::Check || $objListItem->Value == StewardshipContributionType::ReturnedCheck) {
$intIndex++;
} else {
$this->lstStewardshipContributionType->RemoveItem($intIndex);
}
}
$this->txtCheckNumber = $this->mctContribution->txtCheckNumber_Create();
$this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->txtCheckNumber->Select();
}
// Setup Total Amount
$this->lblTotalAmount = new QLabel($this);
$this->lblTotalAmount->HtmlEntities = false;
// Setup Error Panels
$this->pnlFundingError = new QPanel($this);
$this->pnlFundingError->Visible = false;
$this->pnlFundingError->CssClass = 'errorMessage';
$this->pnlPersonError = new QPanel($this);
$this->pnlPersonError->Visible = false;
$this->pnlPersonError->CssClass = 'errorMessage';
// Setup AmountArray
$this->mctAmountArray = array();
$objAmountArray = $this->mctContribution->StewardshipContribution->GetStewardshipContributionAmountArray(QQ::OrderBy(QQN::StewardshipContributionAmount()->Id));
for ($i = 0; $i < 5; $i++) {
if (array_key_exists($i, $objAmountArray)) {
$objAmount = $objAmountArray[$i];
} else {
$objAmount = new StewardshipContributionAmount();
}
$mctAmount = new StewardshipContributionAmountMetaControl($this, $objAmount);
$this->mctAmountArray[] = $mctAmount;
if ($mctAmount->EditMode) {
//.........这里部分代码省略.........
示例4: ResolveContentItem
/**
* Used internally by the Meta-based Add Column tools.
*
* Given a QQNode or a Text String, this will return a StewardshipContributionAmount-based QQNode.
* It will also verify that it is a proper StewardshipContributionAmount-based QQNode, and will throw an exception otherwise.
*
* @param mixed $mixContent
* @return QQNode
*/
protected function ResolveContentItem($mixContent)
{
if ($mixContent instanceof QQNode) {
if (!$mixContent->_ParentNode) {
throw new QCallerException('Content QQNode cannot be a Top Level Node');
}
if ($mixContent->_RootTableName == 'stewardship_contribution_amount') {
if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
$objCurrentNode = $mixContent;
while ($objCurrentNode = $objCurrentNode->_ParentNode) {
if (!$objCurrentNode instanceof QQNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
}
return $mixContent;
} else {
throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "stewardship_contribution_amount".');
}
} else {
if (is_string($mixContent)) {
switch ($mixContent) {
case 'Id':
return QQN::StewardshipContributionAmount()->Id;
case 'StewardshipContributionId':
return QQN::StewardshipContributionAmount()->StewardshipContributionId;
case 'StewardshipContribution':
return QQN::StewardshipContributionAmount()->StewardshipContribution;
case 'StewardshipFundId':
return QQN::StewardshipContributionAmount()->StewardshipFundId;
case 'StewardshipFund':
return QQN::StewardshipContributionAmount()->StewardshipFund;
case 'Amount':
return QQN::StewardshipContributionAmount()->Amount;
default:
throw new QCallerException('Simple Property not found in StewardshipContributionAmountDataGrid content: ' . $mixContent);
}
} else {
if ($mixContent instanceof QQAssociationNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
} else {
throw new QCallerException('Invalid Content type');
}
}
}
}
示例5: GetContributionAmountArrayForPersonArray
/**
* @param integer[] $intPersonIdArray
* @param integer $intYear
* @param integer $intQuarter optional, can be 1, 2 or 3 to limit results to JUST Q1, Q1-Q2, Q1-Q3 data if applicable
* @return StewardshipContributionAmount[]
*/
public static function GetContributionAmountArrayForPersonArray($intPersonIdArray, $intYear, $intQuarter = null)
{
switch ($intQuarter) {
case 1:
$strEndMonthDay = '-03-31 23:59:59';
break;
case 2:
$strEndMonthDay = '-06-30 23:59:59';
break;
case 3:
$strEndMonthDay = '-09-30 23:59:59';
break;
default:
$strEndMonthDay = '-12-31 23:59:59';
break;
}
$objCondition = QQ::AndCondition(QQ::In(QQN::StewardshipContributionAmount()->StewardshipContribution->PersonId, $intPersonIdArray), QQ::GreaterOrEqual(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, new QDateTime($intYear . '-01-01 00:00:00')), QQ::LessOrEqual(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, new QDateTime($intYear . $strEndMonthDay)));
return StewardshipContributionAmount::QueryArray($objCondition, QQ::OrderBy(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, QQN::StewardshipContributionAmount()->Id));
}
示例6: dtgStewardshipContributionAmount_Bind
public function dtgStewardshipContributionAmount_Bind()
{
$this->fltTotal = 0;
if ($this->chkCombined && $this->chkCombined->Checked) {
$intPersonIdArray = array();
foreach ($this->objForm->objHousehold->GetHouseholdParticipationArray() as $objParticipation) {
$intPersonIdArray[] = $objParticipation->PersonId;
}
$objCondition = QQ::In(QQN::StewardshipContributionAmount()->StewardshipContribution->PersonId, $intPersonIdArray);
} else {
$objCondition = QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipContribution->PersonId, $this->objPerson->Id);
}
if ($this->lstYear->SelectedValue) {
$objCondition = QQ::AndCondition($objCondition, QQ::GreaterOrEqual(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, new QDateTime($this->lstYear->SelectedValue . '-01-01 00:00:00')), QQ::LessOrEqual(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, new QDateTime($this->lstYear->SelectedValue . '-12-31 23:59:59')));
}
if ($this->lstFund->SelectedValue) {
$objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipFundId, $this->lstFund->SelectedValue));
}
$this->dtgStewardshipContributionAmount->MetaDataBinder($objCondition);
// Add 'Totals' Row
$objDataSource = $this->dtgStewardshipContributionAmount->DataSource;
$objDataSource[] = new StewardshipContributionAmount();
$this->dtgStewardshipContributionAmount->DataSource = $objDataSource;
}
示例7: dtgLineItems_Unposted_Bind
public function dtgLineItems_Unposted_Bind()
{
$this->dtgLineItems->DataSource = StewardshipContributionAmount::QueryArray(QQ::AndCondition(QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipContribution->UnpostedFlag, true), QQ::Equal(QQN::StewardshipContributionAmount()->StewardshipContribution->StewardshipBatchId, $this->objBatch->Id)), QQ::OrderBy(QQN::StewardshipContributionAmount()->StewardshipContribution->Person->LastName, QQN::StewardshipContributionAmount()->StewardshipContribution->Person->FirstName));
}