añado jsp
This commit is contained in:
@@ -0,0 +1,284 @@
|
||||
<%@ page import="com.tarisan.control.*" %>
|
||||
<%@ page import="com.tarisan.data.*" %>
|
||||
<%@ page import="com.tarisan.excepcion.*" %>
|
||||
<%@ page import="com.tarisan.log.*" %>
|
||||
<%@ page import="com.tarisan.util.Utilidades" %>
|
||||
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%@ page import="java.util.Vector" %>
|
||||
|
||||
<%
|
||||
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de liquidaciones (med/liquidacion.jsp)");
|
||||
|
||||
response.setHeader("Expires", "0");
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
HttpSession sesion = request.getSession(true);
|
||||
|
||||
if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null))
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
|
||||
response.sendRedirect("../../html/login.html");
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// Definicion de variables
|
||||
String strParametroMenu="";
|
||||
StringBuffer strSql = new StringBuffer();
|
||||
int intPagina = 0;
|
||||
double dblImporteTotal=0;
|
||||
Object aCondiciones[]=null;
|
||||
|
||||
//Obtención del perfil del usuario conectado
|
||||
StringBuffer perfil = new StringBuffer();
|
||||
perfil.append("|");
|
||||
perfil.append(sesion.getAttribute("PERFIL"));
|
||||
perfil.append("|");
|
||||
|
||||
//Obtenemos los valores de los parametros que se pasan a la pagina
|
||||
//En caso de que no se le pasen parametros, quedaram inicializados
|
||||
//a sus valores por defecto
|
||||
|
||||
//parametro x para marcar la opcion del menu en la que se encuentra el usuario
|
||||
if (request.getParameter("x")!=null)
|
||||
strParametroMenu=(String)request.getParameter("x");
|
||||
|
||||
//parametro pagina para realizar la paginacion
|
||||
if (request.getParameter("pagina")!=null)
|
||||
intPagina=Integer.parseInt(request.getParameter("pagina"));
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Liquidaciones</title>
|
||||
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
|
||||
|
||||
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
|
||||
<script language="JavaScript" src="../../js/menu_med.js"></script>
|
||||
<script language="JavaScript" src="../../js/bloques_tarisan.js"></script>
|
||||
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function paginacion(pagina)
|
||||
{
|
||||
document.frmLiquidacion.pagina.value=pagina;
|
||||
document.frmLiquidacion.submit();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF">
|
||||
|
||||
<!-- Logotipo de IMQ de Navarra //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr valign="bottom">
|
||||
<td align="center"><img src="../../img/Logo_rosca.jpg" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Datos del usuario conectado //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr>
|
||||
<td class="tituloTabla" align="center"><%= sesion.getAttribute("USUARIO") %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#C02331"><img src="img/sp.gif" width="746" height="1" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Cabecera de Navegación superior //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr>
|
||||
<td><script language="JavaScript">bloques();</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Cuerpo de la página //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr valign="top">
|
||||
<td width="180">
|
||||
<!-- Menú de navegación del módulo (zona izquierda) //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr valign="top">
|
||||
<td colspan="2"><img src="../../img/sp.gif" width="180" height="12" border="0"></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><script language="JavaScript">escribirMenuGst();</script></td>
|
||||
<td><img src="../../img/sp.gif" width="14" height="261" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#CCCCCC"><img src="../../img/sp.gif" width="1" height="12" border="0"></td>
|
||||
<td width="565">
|
||||
<!-- Tabla con el contenido de la página (zona central-derecha) //-->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td><img src="../../img/sp.gif" width="4" height="261" border="0"></td>
|
||||
<td class="txt" valign="top">
|
||||
<img src="../../img/sp.gif" width="1" height="11" border="0"><br>
|
||||
<table border="0" align="center" width="100%">
|
||||
|
||||
<!-- Presentacion de los resultados -->
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
</tr>
|
||||
<form name="frmLiquidacion" action="liquidacion.jsp?x=<%=strParametroMenu%>" method="post">
|
||||
<input type="hidden" name="pagina" value="1">
|
||||
</form>
|
||||
<%
|
||||
//Creación de la tabla presentación de resultados
|
||||
strSql.append("SELECT TAMOVEXT.Acto, Count(TAMOVEXT.Acto) as cantidad, TAMOVEXT.Precio as precioActoMedico, ttactmed.descripcion as descripcionActoMedico");
|
||||
strSql.append(" FROM TAMOVEXT, ttactmed");
|
||||
strSql.append(" WHERE (TAMOVEXT.Acto = ttactmed.Acto)");
|
||||
strSql.append(" AND (TAMOVEXT.Especialidad = ttactmed.Especialidad)");
|
||||
strSql.append(" AND TAMOVEXT.Medico=?");
|
||||
strSql.append(" AND TAMOVEXT.Especialidad=?");
|
||||
strSql.append(" GROUP BY TAMOVEXT.Acto, TAMOVEXT.Precio, ttactmed.descripcion");
|
||||
strSql.append(" ORDER BY TAMOVEXT.Acto ASC");
|
||||
|
||||
aCondiciones = new Object[2];
|
||||
aCondiciones[0] = Integer.valueOf( ((Usuario)sesion.getAttribute("USUARIO")).getMedico() );
|
||||
aCondiciones[1] = Integer.valueOf( ((Usuario)sesion.getAttribute("USUARIO")).getEspecialidad() );
|
||||
|
||||
PersistenciaVTamovextTtactmed per = new PersistenciaVTamovextTtactmed();
|
||||
Vector vSeleccion = per.seleccionar(strSql.toString(), intPagina, aCondiciones);
|
||||
|
||||
if (vSeleccion.size()==0) //No se han encontrado datos
|
||||
{
|
||||
%>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="center"><span class="txt">No se ha encontrado ningún dato.</span></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
else
|
||||
{
|
||||
if (intPagina != 0){ //se tiene en cuenta la paginacion
|
||||
%>
|
||||
<tr>
|
||||
<td colspan="5" align="right"><span class="txt">Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%></span></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<tr>
|
||||
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Código</td>
|
||||
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Descripción</td>
|
||||
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Cantidad</td>
|
||||
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Precio</td>
|
||||
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Importe</td>
|
||||
</tr>
|
||||
<%
|
||||
|
||||
VTamovextTtactmed vTamovextttactmed = null;
|
||||
String estilo = "";
|
||||
for(int i = 0; i < vSeleccion.size(); i++)
|
||||
{
|
||||
if (i % 2 == 0)
|
||||
{
|
||||
estilo = "filaA";
|
||||
}
|
||||
else
|
||||
{
|
||||
estilo = "filaB";
|
||||
}
|
||||
vTamovextttactmed = (VTamovextTtactmed)vSeleccion.elementAt(i);
|
||||
|
||||
//vamos calculando el importe total
|
||||
dblImporteTotal=dblImporteTotal + vTamovextttactmed.getImporteActoMedico();
|
||||
%>
|
||||
<tr>
|
||||
<td class="<%=estilo%>" align="center"><%=vTamovextttactmed.getActo()%></td>
|
||||
<td class="<%=estilo%>" align="left"><%=vTamovextttactmed.getDescripcionActoMedico()%></td>
|
||||
<td class="<%=estilo%>" align="center"><%=vTamovextttactmed.getCantidad()%></td>
|
||||
<td class="<%=estilo%>" align="right"><%=Utilidades.formatearDouble(vTamovextttactmed.getPrecioActoMedico(),PersistenciaParametros.decimales)%></td>
|
||||
<td class="<%=estilo%>" align="right"><%=Utilidades.formatearDouble(vTamovextttactmed.getImporteActoMedico(),PersistenciaParametros.decimales)%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<% if (intPagina!=0){ //se tiene en cuenta la paginacion %>
|
||||
<tr><td colspan="5"></td></tr>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<%if (per.getPaginacion().esPrimeraPagina()){%>
|
||||
<td width="70" align="right"><span class="pagDesactivo">primero</span></td>
|
||||
<td></td>
|
||||
<td width="70" align="left"><span class="pagDesactivo">anterior</span></td>
|
||||
<%}else{%>
|
||||
<td width="70" align="right"><a href="javascript:paginacion(1)" class="enlace">primero</a></td>
|
||||
<td></td>
|
||||
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() - 1%>)" class="enlace">anterior</a></td>
|
||||
<%}%>
|
||||
|
||||
<%if (per.getPaginacion().esUltimaPagina()){%>
|
||||
<td width="70" align="right"><span class="pagDesactivo">siguiente</span></td>
|
||||
<td></td>
|
||||
<td width="70" align="left"><span class="pagDesactivo">último</span></td>
|
||||
<%}else{%>
|
||||
<td width="70" align="right"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() + 1%>)" class="enlace">siguiente</a></td>
|
||||
<td></td>
|
||||
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPaginasTotales()%>)" class="enlace">último</a></td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
} //fin if(pagina!=0)
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right"><span class="txtNegrita">Importe total: </span><span class="txt"><%=Utilidades.formatearDouble(dblImporteTotal,PersistenciaParametros.decimales)%></span></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
} //fin else (vSeleccion.size()!=0)
|
||||
%>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<%
|
||||
}
|
||||
catch(ExcepcionTarisan ex)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "ExcepcionTarisan: " + ex.getMensaje());
|
||||
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex.getMensaje());
|
||||
response.sendRedirect("../error.jsp");
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex);
|
||||
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex);
|
||||
response.sendRedirect("../error.jsp");
|
||||
}
|
||||
}
|
||||
LogTarisan.logger.log(NivelLog.INFO, "Final página de gestión de liquidaciones (med/liquidacion.jsp)");
|
||||
%>
|
||||
Reference in New Issue
Block a user