예제 #1
0
파일: print_report.php 프로젝트: alcf/chms
 protected function Form_Create()
 {
     switch (QApplication::PathInfo(0)) {
         case 'funds':
             $this->dtgReport = new QDataGrid($this);
             $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=300px'));
             $this->dtgReport->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM->StewardshipFund->AccountNumber; ?>', 'Width=200px'));
             $this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=245px'));
             $this->dtgReport->NoDataHtml = 'Changes only to members credited.  (No changes to funding accounts or amounts)';
             $this->dtgReport->SetDataBinder('dtgReport_Funds_Bind');
             break;
         case 'line_items':
             $this->dtgReport = new QDataGrid($this);
             $this->dtgReport->AddColumn(new QDataGridColumn('Person', '<?= $_ITEM->Person->Name; ?>', 'Width=200px'));
             $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=200px'));
             $this->dtgReport->AddColumn(new QDataGridColumn('Description', '<?= $_ITEM->Description; ?>', 'Width=200px'));
             $this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=130px'));
             $this->dtgReport->SetDataBinder('dtgReport_LineItems_Bind');
             break;
         default:
             QApplication::Redirect('/stewardship/');
             break;
     }
     $this->objBatch = StewardshipBatch::Load(QApplication::PathInfo(1));
     if (!$this->objBatch) {
         QApplication::Redirect('/stewardship/');
     }
     $this->objPost = StewardshipPost::LoadByStewardshipBatchIdPostNumber($this->objBatch->Id, QApplication::PathInfo(2));
     if (!$this->objPost) {
         QApplication::Redirect('/stewardship/');
     }
 }
예제 #2
0
 protected function SetupPanel()
 {
     $this->objPost = StewardshipPost::LoadByStewardshipBatchIdPostNumber($this->objBatch->Id, $this->strUrlHashArgument);
     $this->btnSave->Text = 'Post Unposted Funds';
     $this->btnSave->RemoveAllActions(QClickEvent::EventName);
     $this->btnSave->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to POST these funds?  This cannot be undone.'));
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
     $this->btnSave->Visible = false;
     if ($this->objPost) {
         $this->dtgFunds = new QDataGrid($this);
         $this->dtgFunds->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=340px'));
         $this->dtgFunds->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM->StewardshipFund->AccountNumber; ?>', 'Width=200px'));
         $this->dtgFunds->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=200px'));
         $this->dtgFunds->NoDataHtml = 'Changes only to members credited.  (No changes to funding accounts or amounts)';
         $this->dtgFunds->SetDataBinder('dtgFunds_Posted_Bind', $this);
         $this->dtgLineItems = new QDataGrid($this);
         $this->dtgLineItems->AddColumn(new QDataGridColumn('Person', '<?= $_ITEM->Person->Name; ?>', 'Width=200px'));
         $this->dtgLineItems->AddColumn(new QDataGridColumn('Fund', '<?= $_CONTROL->ParentControl->RenderStewardshipFundName($_ITEM); ?>', 'Width=200px', 'HtmlEntities=false'));
         $this->dtgLineItems->AddColumn(new QDataGridColumn('Description', '<?= $_ITEM->Description; ?>', 'Width=200px'));
         $this->dtgLineItems->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=130px'));
         $this->dtgLineItems->SetDataBinder('dtgLineItems_Posted_Bind', $this);
     } else {
         if ($this->objBatch->StewardshipBatchStatusTypeId != StewardshipBatchStatusType::PostedInFull) {
             $this->dtgFunds = new QDataGrid($this);
             $this->dtgFunds->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM[0]; ?>', 'Width=500px'));
             $this->dtgFunds->AddColumn(new QDataGridColumn('Amount', '<?= $_ITEM[1]; ?>', 'HtmlEntities=false', 'Width=245px'));
             $this->dtgFunds->NoDataHtml = 'Changes only to members credited.  (No changes to funding accounts or amounts)';
             $this->dtgFunds->SetDataBinder('dtgFunds_Unposted_Bind', $this);
             $this->dtgLineItems = new QDataGrid($this);
             $this->dtgLineItems->AddColumn(new QDataGridColumn('Person', '<?= $_ITEM->StewardshipContribution->Person->Name; ?>', 'Width=300px'));
             $this->dtgLineItems->AddColumn(new QDataGridColumn('Fund', '<?= $_CONTROL->ParentControl->RenderStewardshipFundName($_ITEM); ?>', 'Width=300px', 'HtmlEntities=false'));
             $this->dtgLineItems->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=130px'));
             $this->dtgLineItems->SetDataBinder('dtgLineItems_Unposted_Bind', $this);
             $this->btnSave->Visible = true;
         } else {
             return $this->ReturnTo('#/post_batch');
         }
     }
 }