<%@ page import="gov.va.med.esr.ui.util.SessionManager"%>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>
<%@ page import='gov.va.med.esr.common.model.lookup.IncomeTestSource' %>

<c:set var="deleteIncomeTestCode"><%=Capability.DELETE_INCOME_TEST.getName()%></c:set>
<c:set var="incomeYear"><%= session.getAttribute(SessionManager.SELECTED_FINANCIAL_INCOME_YEAR) %></c:set>
<c:set var="HEC_SOURCE"><%=IncomeTestSource.CODE_HEC.getCode()%></c:set>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html-el:form action="/financialDetailsEdit" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
  <tr>
    <td width="100%">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableBody" role="presentation">
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
              <tr>
                <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="28" height="23"/></td>
                <td nowrap style="padding-left: 7"><bean-el:message key="financials.editFinDetails.title" /></td>
                <td align="left" nowrap>&nbsp;(<bean-el:message key="title.incomeyear"/>&nbsp;<c:out value="${incomeYear}"/>)</td>
                <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
              	<td nowrap class="moduleBlueLink" style="padding: 1 8 1 8"><html-el:link action="financialsDependentOverview?methodName=DEPENDENTS"><bean-el:message key="link.button.viewEditDeps"/></html-el:link></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableBody" role="presentation">
              <tr>
                  <td colspan="2">
                    <%@ include file="/tiles/common/instructionalText.jsp" %>
                  </td>
              </tr>
              <tr>
                <td>
<%@ include file="financialDetailsForm.jsp" %>
               </td>
              </tr>
              <tr><td>&nbsp;</td></tr>
              <tr>
                <td class="moduleValue">
                  <table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" role="presentation">
                    <tr>
                      <td width="50%"><img alt=""  src="../images/spacer.gif"/></td>
                      <c:if test="${financialsUpdateAllowed != 'false'}">
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:100; vertical-align: top;" styleClass="buttonText"><bean:message key="button.reviewImpact"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <td width="2%"><img alt=""  src="../images/spacer.gif"/></td>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:100; vertical-align: top;" styleClass="buttonText"><bean:message key="button.saveInProcess"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <td width="2%"><img alt=""  src="../images/spacer.gif"/></td>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:100; vertical-align: top;" styleClass="buttonText"><bean:message key="button.acceptChanges"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <td width="2%"><img alt=""  src="../images/spacer.gif"/></td>
                      </c:if>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:50; vertical-align: top;" styleClass="buttonText"><bean:message key="button.cancel"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <c:if test="${financialDetailsForm.incomeTestAvaliableInd == 'true'}">
                      <auth:authorize ifAnyGranted="${deleteIncomeTestCode}">
                      <c:if test="${financialDetailsForm.sourceOfTest == HEC_SOURCE}">
                      <td width="2%"><img alt=""  src="../images/spacer.gif"/></td>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:110; vertical-align: top;" styleClass="buttonText"><bean:message key="button.deleteIncomeTest"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      </c:if>
                      </auth:authorize>
                      </c:if>
                      <td width="50%"><img alt=""  src="../images/spacer.gif"/></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</html-el:form>
</table>
