/** * Adds a payment records for this Entry * @param integer $intSignupPaymentTypeId * @param float $fltAmount * @param string $strTransactionDescription * @param QDateTime $dttTransactionDate optional, uses Now() if nothing is passed in * @return SignupPayment */ public function AddPayment($intSignupPaymentTypeId, $fltAmount, $strTransactionDescription, QDateTime $dttTransactionDate = null) { $objSignupPayment = new SignupPayment(); $objSignupPayment->SignupEntry = $this; $objSignupPayment->SignupPaymentTypeId = $intSignupPaymentTypeId; $objSignupPayment->TransactionDate = $dttTransactionDate ? $dttTransactionDate : QDateTime::Now(); $objSignupPayment->TransactionDescription = $strTransactionDescription; $objSignupPayment->Amount = $fltAmount; $objSignupPayment->Save(); $this->RefreshAmounts(); return $objSignupPayment; }
/** * @return boolean whether or not the save was successful */ protected function PerformPaymentSave() { if (!$this->objPayment->TransactionDate) { $this->objPayment->TransactionDate = QDateTime::Now(); } $this->objPayment->TransactionDescription = trim($this->txtTextbox->Text); $this->objPayment->Amount = $this->txtFloat->Text; $this->objPayment->Save(); return true; }