예제 #1
0
 public static function GetPostAndValidateTenancy($mTransactions)
 {
     ProTransactions::GetPostOnly($mTransactions);
     $mTransactions->validate();
     $mTransactions->mPropertyDetail->validate();
     if ($mTransactions->type == ProTransactions::FOR_RENT) {
         // it alway for rent
         if (!empty($mTransactions->mTenatDefault->user_id)) {
             $mTransactions->mTenatDefault->scenario = 'AgentAddTenantExitUid';
         }
         $mTransactions->mTenatDefault->validate();
         Users::validateDefaultTenant($mTransactions->mTenatDefault);
     }
     $cAction = Yii::app()->controller->action->id;
     if ($cAction == 'update' && ProTransactions::IsTenancyTransaction($mTransactions)) {
         if ($mTransactions->mBillTo->bill_to_id == ProTransactions::BILL_TO_SOLICITOR) {
             $mTransactions->mBillTo->scenario = 'CreateVendorPurchaserSolicitorSelected';
         } elseif ($mTransactions->mBillTo->bill_to_id == ProTransactions::BILL_TO_EXTERNAL_CO_BROKE) {
             $mTransactions->mBillTo->scenario = 'ExternalCoBrokeSelected';
             ProTransactionsBillTo::ResetVal($mTransactions->mBillTo);
         }
         $mTransactions->mBillTo->validate();
     }
     ProTransactionsPropertyDocument::validateFile($mTransactions);
     if ($mTransactions->type == ProTransactions::FOR_RENT) {
         ProTransactions::validateLandlordTenant($mTransactions);
     } else {
         // for sale - validate for vendor and purcharser
         ProTransactions::validateVendorPurchaser($mTransactions);
     }
 }
예제 #2
0
     $mTransactions->mPropertyDetail->scenario = 'CreateTransactionTenancyOnly';
     //        Close Now 28, 2014 $mTransactions->mPropertyDetail->scenario = 'CreateTransactionFromListing';
     //        if(isset($_GET['list']) && $_GET['list']=='transaction'){
     //            $mTransactions->mPropertyDetail->scenario = 'CreateTransaction';
     //        }
     $mTransactions->mTenatDefault->scenario = 'AgentAddTenantFromTenancy';
     //            $mTransactions->mPropertyDocument->scenario = 'UploadDocument';
     $mTransactions->scenario = 'CreateTransactionForRentRecordTenancy';
     // for rent
     ProTransactions::copyFromListingToTransaction($mTransactions);
     ProTransactions::convertToUserDate($mTransactions);
     // chưa làm phần update cho transaction??
     //            ProTransactions::convertToUserDate($mTransactions);
 }
 /**
  * @Author: ANH DUNG Dec 01, 2014
  * @Todo: handle POST for create tenancy without create transaction
  */
 public function HandlePost($mTransactions)
 {
     if (isset($_POST['ProTransactionsPropertyDetail'])) {
         $this->HandleSaveAsDraft($mTransactions);