private function createOrUpdateLedgerAccount($p_name, $p_type, $p_id = NULL)
    {
        if (!SchemaDef::IsValidLedgerAccountName($p_name)) {
            throw new Exception("Invalid LedgerAccount name ({$p_name})");
        }
        if ($this->doesExistAndNotThis($p_name, $p_type, $p_id)) {
            throw new Exception("LedgerAccount ({$p_name}, {$p_type}) already exists.");
        }
        $v_accountID = is_null($p_id) ? CloudBankServer::UUID() : $p_id;
        $v_bindArray = array(':id' => $v_accountID, ':name' => $p_name);
        if (is_null($p_id)) {
            $v_bindArray[':type'] = $p_type;
        }
        $this->r_cloudBankServer->execQuery(is_null($p_id) ? '
		  INSERT 
		     INTO ledger_account(id, name, type) VALUES (
			:id, :name, :type
		     )
	       ' : 'UPDATE ledger_account SET name = :name WHERE id = :id', $v_bindArray);
        return $v_accountID;
    }