예제 #1
0
파일: batch.php 프로젝트: alcf/chms
 protected function Transactions_Refresh()
 {
     // Cache the Payment Array for actual trackable payments
     $this->objPaymentArray = CreditCardPayment::LoadArrayByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, false, QQ::OrderBy(QQN::CreditCardPayment()->DateCaptured));
     if ($this->objBatch->ReconciledFlag) {
         $this->lblInstructionHtml->Text = sprintf('This PayPal Batch was posted to NOAH on <strong>%s</strong>.<br/><strong>No more changes can be made to this PayPal Batch.</strong><br/><br/>' . 'Click the following to view the linked <strong><a href="/stewardship/batch.php/%s#1">Stewardship Batch</a></strong>.<br/>' . 'Click on any <strong>Date Captured</strong> below on a credit card transaction with a donation record to view its linked Stewardship Entry.', $this->objBatch->DateReconciled->ToString('MMMM D YYYY at h:mm z'), $this->objBatch->StewardshipBatchId);
         $this->btnPost->Visible = false;
         $this->btnSplit->Visible = false;
         $this->dtxDateCredited->Visible = false;
     } else {
         if ($this->objBatch->IsUncategorizedPaymentsExist()) {
             $this->lblInstructionHtml->Text = 'There are currently unspecified funding accounts for one more more credit card payment line item.  Please ensure all items are accounted for before posting to NOAH.';
             $this->btnPost->Visible = false;
             $this->btnSplit->Visible = false;
             $this->dtxDateCredited->Visible = false;
             if (CreditCardPayment::CountByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, true)) {
                 $this->lblInstructionHtml->Text .= '<br/><br/><strong>WARNING!</strong>  There are unaccountable Credit Card Payment records in this batch!';
             }
         } else {
             $this->lblInstructionHtml->Text = 'This PayPal Batch has not yet been posted to NOAH.  Click on <strong>Post to NOAH</strong> when you are sure that there are no more changes or additions left for this batch.';
             $this->btnPost->Visible = true;
             $this->btnSplit->Visible = true;
             $this->dtxDateCredited->Visible = true;
             $this->btnPost->RemoveAllActions(QClickEvent::EventName);
             if (CreditCardPayment::CountByPaypalBatchIdUnlinkedFlag($this->objBatch->Id, true)) {
                 $this->lblInstructionHtml->Text .= '<br/><br/><strong>WARNING!</strong>  There are unaccountable Credit Card Payment records in this batch!';
                 $this->btnPost->AddAction(new QClickEvent(), new QConfirmAction('NOTE!  There are unaccountable Credit Card Payment records in this batch!  You are about to PERMANENTLY post this batch to NOAH.  No changes can be made after this point.  Are you SURE you want to proceed?'));
                 $this->btnPost->AddAction(new QClickEvent(), new QAjaxAction('btnPost_Click'));
             } else {
                 $this->btnPost->AddAction(new QClickEvent(), new QConfirmAction('You are about to PERMANENTLY post this batch to NOAH.  No changes can be made after this point.  Are you SURE you want to proceed?'));
                 $this->btnPost->AddAction(new QClickEvent(), new QAjaxAction('btnPost_Click'));
             }
         }
     }
     $this->dtgTransactions->Refresh();
     $this->dtgFunding->Refresh();
 }