Exemple #1
0
	function getByNumber($number){
		$Check = SI_Check::retrieveSet("WHERE number = '$number'", TRUE);
		if($Check === FALSE){
			return FALSE;
		}

		if(isset($Check[0])){
			$this->_populateData($Check[0]);
			if($this->_populateCommTransactions() === FALSE)
				return FALSE;
			if($this->_populateCostTransactions() === FALSE)
				return FALSE;
			$this->stripSlashes();
		}else{
			$this->error = "SI_Check::getByNumber() : No data retrieved from query\n";
			return FALSE;
		}
		return TRUE;
	}
Exemple #2
0
$user = new SI_User();
$users = $user->getUnpaidUsers();
if($users === FALSE){
	$error_msg .= "Could not retrieve Unpaid Users's list!\n";
	debug_message($user->getLastError());
}

$invoice = new SI_Invoice();
$invoices = $invoice->getOutstanding();
if($invoices === FALSE){
	$error_msg .= "Could not retrieve Outstanding Invoice list!\n";
	debug_message($invoice->getLastError());
}

$check = new SI_Check();
$checks = $check->retrieveSet("ORDER BY timestamp DESC LIMIT 5");
if($checks === FALSE){
	$error_msg .= "Could not retrieve Check list!\n";
	debug_message($check->getLastError());
}

$ps = new SI_PaymentSchedule();
$time = time() + 30 * (24 * (60 * 60));
$ps_items = $ps->getUpcoming($time);
if($ps_items === FALSE){
	$error_msg .= "Could not retreive upcoming scheduled billings!\n";
	debug_message($ps->getLastError());
}

$expense = new SI_Expense();
$expenses = $expense->getUnbilled();
Exemple #3
0
	function getChecks($id = NULL, $limit = 0, $offset = 0){
		global $db_conn;

		if($id === NULL){
			$id = intval($this->id);
		}else{
			$id = intval($id);
		}

		$limit_sql = '';		
		if($limit > 0 || $offset > 0){
			$limit_sql = " LIMIT $offset, $limit ";
		}

		$check = new SI_Check();
		$result = $check->retrieveSet("WHERE user_id = $id $limit_sql");
		if($result === FALSE){
			$this->error = "SI_User::getChecks(): Error getting checks: ".$check->getLastError();
			return FALSE;
		}

		return $result;
	}
	function _getLinked(){
		$id = intval($this->id);
		if($id <= 0)
			return TRUE;
			
		if($this->_ta == FALSE){
			$ta = new SI_TaskActivity();
			$tas = $ta->retrieveSet("WHERE a.cost_trans_id = $id OR a.com_trans_id = $id");
			if($tas === FALSE){
				$this->error = "Error getting linked task: ".$ta->getLastError();
				return FALSE;	
			}
			if(count($tas) == 1){
				$this->_ta = &$tas[0];
			}
		}
		
		if($this->_check == FALSE){
			$check = new SI_Check();
			$checks = $check->retrieveSet("WHERE trans_id = $id");
			if($checks === FALSE){
				$this->error = "Error getting linked task: ".$check->getLastError();
				return FALSE;	
			}
			if(count($checks) == 1){
				$this->_check = &$checks[0];
			}
		}

		return TRUE;
	}