Files
tarisan_gitea/jsp/med/detalleIRPF.jsp
T
2025-06-09 13:55:08 +02:00

364 lines
12 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%@ 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" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.tarisan.util.DES" %>
<%
// LogTarisan.logger.log(NivelLog.INFO, "Inicio p墔ina detalle IRPF (med/detalleIRPF.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鏮 invalidada");
response.sendRedirect("../../html/login.html");
}
else
{
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + "Inicio p墔ina detalle IRPF (med/detalleIRPF.jsp)");
try
{
// Definicion de variables
String strParametroMenu="";
String strCampoAnio=String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
StringBuffer strSql = new StringBuffer();
int intPagina=0;
Object aCondiciones[]=null;
SimpleDateFormat sdfFormateadorFecha=new SimpleDateFormat(PersistenciaParametros.formatoFechas);
//Obtenci鏮 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 descripcion para las busquedas
if (request.getParameter("anio")!=null)
strCampoAnio = (String)request.getParameter("anio");
//parametro pagina para realizar la paginacion
if (request.getParameter("pagina")!=null)
intPagina=Integer.parseInt(request.getParameter("pagina"));
//parametro impresion que nos indica que se ha de realizar una impresion
int intImpresion = 0;
if (request.getParameter("imp")!=null) {
intImpresion = Integer.parseInt(request.getParameter("imp"));
}
//atributo ENC que obtiene la peticion encriptada
String irpfE = "";
if (sesion.getAttribute("ENC")!=null) {
irpfE = (String)sesion.getAttribute("ENC");
sesion.removeAttribute("ENC");
}
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
boolean mostrarNoticia = true;
PersistenciaTanoticias perTaNo = new PersistenciaTanoticias();
Vector vSeleccionNot = perTaNo.obtener_noticias_cabecera();
Vector vNoticias = new Vector();
String strNoticia = "";
String noticias ="";
String separador = " ---//--- ";
if(vSeleccionNot.size()==0){
mostrarNoticia = false;
}else{
mostrarNoticia = true;
Tanoticias tanoticia = null;
for(int i = 0; i < vSeleccionNot.size(); i++)
{
tanoticia = (Tanoticias)vSeleccionNot.elementAt(i);
if (i!=0){
strNoticia = strNoticia + separador + tanoticia.getNoticia();
}else{
strNoticia = tanoticia.getNoticia();
}
strNoticia = strNoticia.replaceAll("<br/>", " ");
}
}
%>
<html>
<head>
<title>I.R.P.F.</title>
<link rel="shortcut icon" href="../../img/logo.ico" />
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
<link rel="STYLESHEET" type="text/css" href="../../css/jquery.modal.css">
<script language="JavaScript" src="../../js/funciones.js"></script>
<script language="JavaScript" src="../../js/jquery-1.11.3.js"></script>
<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" src="../../js/jquery.modal.min.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
function buscar()
{
var anio = document.frmDetalleIrpf.anio.value;
if ((anio.length<4 || !soloNumeros(anio)) && anio!="")
{
//alert("El a隳 debe ser un valor num廨ico de 4 digitos.");
modal({type:'error',title:'tenci鏮!',text:'El a隳 debe ser un valor num廨ico de 4 digitos.',});
document.frmDetalleIrpf.anio.focus();
}
else
{
document.frmDetalleIrpf.pagina.value=1;
document.frmDetalleIrpf.submit();
}
}
function paginacion(pagina)
{
document.frmDetalleIrpf.pagina.value=pagina;
document.frmDetalleIrpf.submit();
}
function comprobarImpresion(impresion)
{
if (impresion==1) { //se efectua la impresion
document.frmImprimirPeticion.nombrePDF.value = "<%=irpfE%>";
document.frmImprimirPeticion.submit();
}
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onload="javascript:comprobarImpresion(<%=intImpresion%>);">
<div class="marco">
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr>
<td class="tdLogoCabecera"><img src="<%=request.getContextPath()%>/img/logo.png" class="logoCabecera"></td>
<td>
<table width="100%">
<tr><td class="tituloTablaMedico" align="center"><%= sesion.getAttribute("USUARIO") %></td></tr>
<tr>
<td>
<div id="contenedorNoticia">
<br>
<div class="tituloNoticia">
<p class="marquee"><%=strNoticia %></p>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Cabecera de Navegaci鏮 superior //-->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr>
<td><script language="JavaScript">bloques();</script></td>
</tr>
</table>
<br>
<!-- Cuerpo de la p墔ina //-->
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
<tr valign="top">
<!--<td width="180">//-->
<td width="5%">
<!-- Men de navegaci鏮 del m鏚ulo (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>
</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墔ina (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 width="1px" bgcolor="#CCCCCC" height="330px"></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="3">&nbsp;</td></tr>
<%
int intMedico = ((Usuario)sesion.getAttribute("USUARIO")).getMedico();
PersistenciaTaliquimedi perTaliqui = new PersistenciaTaliquimedi();
boolean retencion = perTaliqui.tiene_retencion_por_taliquimedico(intMedico);
if (retencion){
%>
<tr>
<form name="frmDetalleIrpf" action="detalleIRPF.jsp?x=<%=strParametroMenu%>" method="post">
<td colspan="3">
<table border="0" align="center">
<tr>
<td><span class="txtnegrita">A隳: </span></td>
<td><input type="text" size="4" name="anio" class="txt" value="<%=strCampoAnio%>" maxlength="4"></td>
<td>&nbsp;</td>
<td><a href="javascript:buscar()" class="enlace"><%=pertamensaje.obtenerMensaje(24).getMensaje() %></a></td>
</tr>
</table>
</td>
<input type="hidden" name="pagina" value="1">
</form>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
<%
PersistenciaTadremed per = new PersistenciaTadremed();
Vector vSeleccion = per.listado_detalle_irpf(strCampoAnio, intMedico/*, intPagina*/);
if (vSeleccion.size()==0) //No se han encontrado datos
{
%>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><span class="txt">No existe informaci鏮 para el a隳 seleccionado.</span></td>
</tr>
<%
}
else
{
%>
<tr>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Fecha</td>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Importe devengado</td>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Retenci鏮</td>
</tr>
<%
Tadremed tadremed = null;
String estilo = "";
for(int i = 0; i < vSeleccion.size(); i++)
{
if (i % 2 == 0)
{
estilo = "filaA";
}
else
{
estilo = "filaB";
}
tadremed = (Tadremed)vSeleccion.elementAt(i);
%>
<tr class="trResultados">
<td class="<%=estilo%>" align="center"><%=sdfFormateadorFecha.format(tadremed.getFecha())%></td>
<td class="<%=estilo%>" align="right"><%=Utilidades.formatearDouble(tadremed.getImporte(),PersistenciaParametros.decimales)%></td>
<td class="<%=estilo%>" align="right"><%=Utilidades.formatearDouble(tadremed.getIrpf(),PersistenciaParametros.decimales)%></td>
</tr>
<%
}
%>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="center">
<form name="frmLiqui" action="<%=request.getContextPath()%>/servlet/GestorMedicos" target="blank" method="post" style="margin-bottom: 0px">
<input type="hidden" name="anio" value="<%=strCampoAnio%>"/>
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_MED_GENERAR_DETALLE_IRPF%>">
<input type="submit" value="Certificado" class="enlace"/>
</form>
</td>
</tr>
<%
} //fin else (vSeleccion.size()!=0)
}else{
%>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><span class="txt">El m嶮ico no tiene retenciones.</span></td>
</tr><%
}
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<form name="frmImprimirPeticion" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="width:50%;margin-bottom: 0px">
<input type="hidden" name="tipo" value="19"/>
<input type="hidden" name="nombrePDF" value="" />
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
</form>
</body>
</html>
<script>
var jsMostrarNoticia = <%=mostrarNoticia %>;
if (!jsMostrarNoticia){
document.getElementById('contenedorNoticia').style.display="none";
}else{
<% strNoticia = strNoticia.replaceAll("\"", "'"); %>
var not = "<%=strNoticia %>";
tamanioNoticia(not);
marquee($('.tituloNoticia'), $('.marquee'),not);
}
</script>
<%
}
catch(Exception ex)
{
LogTarisan.logger.log(NivelLog.ERROR, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Exception: " + ex);
sesion.setAttribute("ERROR", "Error en la presentaci鏮 de la p墔ina al usuario.");
response.sendRedirect("../error.jsp");
}
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + "Final p墔ina detalle IRPF (med/detalleIRPF.jsp)");
}
%>