<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/displaytag" prefix="display" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/valuelist" prefix="vlh" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>


<c:set var="canResubmit" value="false"/>
<auth:authorize ifAnyGranted="<%=Capability.MANAGE_ACA_COMMUNICATIONS.getName()%>">
  <c:set var="canResubmit" value="true"/>
</auth:authorize>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<tr>
 <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
    <tr>
     <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
       <tr>
        <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="25" height="15"/></td>
        <td nowrap style="padding-left: 7">Veteran Minimum Essential Coverage Transmissions to the IRS</td>
        <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
        <c:if test="${canResubmit == true}">
        <td nowrap class="moduleBlueLink"
			style="padding: 1px 8px 1px 8px"><fw:link
			action="/commslog.do?methodName=IRS Correction">
			<bean-el:message key="text.submitCorrection" />
		</fw:link></td>
		</c:if>
       </tr>
      </table>
     </td>
    </tr>
    <tr>
     <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
		       <c:choose>
		        <c:when test="${vlhlist.valueListInfo.totalNumberOfEntries == 0}">
		         <tr>
		          <td class="darkValue" style="padding:10 0 10 10; text-align: left"><bean-el:message key="label.noDataAvailable"/></td>
		         </tr>
		        </c:when>
		        <c:otherwise>
			      <tr valign="top" width="100%">
			        <td vAlign="top" align="center">
			          <div id="irsComm" style="border-width:0px;">
			            <table id="irsCommResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
			              <vlh:root id="irsCommTableId" value="vlhlist" url="?" includeParameters="*" configName="valueListConfigBeanLookAndFeel">
			              <vlh:addParam name="checkboxName" value="Select" temp="false"/>
			              <tr>
			                <td colspan="5">
			                  <table class="pagelinks">
			                    <tr>
			                      <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
			                        <td width="5%" nowrap="true">
			                          <span class="pagebanner"><c:out value="${vlhlist.valueListInfo.totalNumberOfEntries}"/> Total
			                          - Page (<c:out value="${vlhlist.valueListInfo.pagingPage}"/> of <c:out value="${vlhlist.valueListInfo.totalNumberOfPages}"/>).
			                          &nbsp;</span>
			                        </td>
			                        <td width="5%">
			                      <c:choose>
			                      <c:when test="${vlhlist.valueListInfo.totalNumberOfPages > 1}">
			                        <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagefutureEGTSettingsTableId}"/>&nbsp;</vlh:paging>
			                      </c:when>
			                      <c:otherwise>
			                        &nbsp;
			                      </c:otherwise>
			                      </c:choose>
			                    </td>
			                      <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
			                    </tr>
			                  </table>
			                </td>
			              </tr>
			              <tr vAlign="top">
			                <td vAlign="top" align="center">
			                  <table summary="List of IRS ACA Transmissions sent on behalf of Veteran" rules="all" class="TableDisplay">
			                    <tr>
			                      <vlh:row bean="commsTemplate">

			                      <c:choose>
									<c:when test="${commsTemplate.batchTransmissionEntry.correctionInd == 'O'}">
										<c:set var="submitType" value="Original"/>
									</c:when>
									<c:when test="${commsTemplate.batchTransmissionEntry.correctionInd == 'C'}">
										<c:set var="submitType" value="Correction"/>
									</c:when>
									<c:when test="${commsTemplate.batchTransmissionEntry.correctionInd == 'R'}">
										<c:set var="submitType" value="Replacement"/>
									</c:when>
									<c:otherwise>
										<c:set var="submitType" value="Unknown"/>
									</c:otherwise>
								</c:choose>

									<vlh:column titleKey="table.year" property="batchTransmissionEntry.taxYear" attributes="align=\"left\" scope='col'" default="">
										<vlh:attribute name="scope">row</vlh:attribute>
			                          <esrcore:displayValue name="IrsTransmissionLogDetailEntry" property="batchTransmissionEntry.taxYear" nullText=""/>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsSubmitType" property="type" attributes="align=\"left\" scope='col'" default="">
			                         	<c:out value="${submitType}"/>
			                        </vlh:column>

			                        <vlh:column titleKey="table.irsStatus" property="status" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayValue name="IrsTransmissionLogDetailEntry" property="status" nullText=""/>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsErrorText" property="errorDescription" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayValue name="IrsTransmissionLogDetailEntry" property="errorDescription" nullText=""/>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsTransmitDate" property="batchTransmissionEntry.transmissionDate" format="MM/dd/yyyy h:mm:ss a" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayDate name="IrsTransmissionLogDetailEntry" dateProperty="batchTransmissionEntry.transmissionDate" format="MM/dd/yyyy h:mm:ss a"/>
			                        </vlh:column>

					               <vlh:column titleKey="table.coverageMonths" property="submittedData.coverageMonthsDisplay" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayValue name="IrsTransmissionLogDetailEntry" property="submittedData.coverageMonthsDisplay" nullText=""/>
			                        </vlh:column>
			                      </vlh:row>
			                    </tr>
			                  </table>
			                </td>
			               </tr>
			              </vlh:root>
			            </table>
			          </div>
			        </td>
			      </tr>
	            </c:otherwise>
	           </c:choose>

				</table>
			 <!-- module shell table body-->
	   </td>
	  </tr>

	 </table>
	 <!-- module shell table  -->
   </td>
</tr>
</table>
<!-- module shell -->

<br/>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<tr>
 <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
    <tr>
     <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
       <tr>
        <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="25" height="15"/></td>
        <td nowrap style="padding-left: 7">ACA Mail Correspondence Sent on Behalf of Veteran</td>
        <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
        <c:if test="${canResubmit == true}">
        <td nowrap class="moduleBlueLink"
			style="padding: 1px 8px 1px 8px"><fw:link
			action="/commslog.do?methodName=IRS Correction">
			<bean-el:message key="text.submitCorrection" />
		</fw:link></td>
		</c:if>
       </tr>
      </table>
     </td>
    </tr>
    <tr>
     <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
		       <c:choose>
		        <c:when test="${vlhlistmail.valueListInfo.totalNumberOfEntries == 0}">
		         <tr>
		          <td class="darkValue" style="padding:10 0 10 10; text-align: left"><bean-el:message key="label.noDataAvailable"/></td>
		         </tr>
		        </c:when>
		        <c:otherwise>
			      <tr valign="top" width="100%">
			        <td vAlign="top" align="center">
			          <div id="irsCommMail" style="border-width:0px;">
			            <table id="irsCommResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
			              <vlh:root id="irsMailCommTableId" value="vlhlistmail" url="?" includeParameters="*" configName="valueListConfigBeanLookAndFeel">
			              <vlh:addParam name="checkboxName" value="Select" temp="false"/>
			              <tr>
			                <td colspan="5">
			                  <table class="pagelinks">
			                    <tr>
			                      <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
			                        <td width="5%" nowrap="true">
			                          <span class="pagebanner"><c:out value="${vlhlistmail.valueListInfo.totalNumberOfEntries}"/> Total
			                          - Page (<c:out value="${vlhlistmail.valueListInfo.pagingPage}"/> of <c:out value="${vlhlistmail.valueListInfo.totalNumberOfPages}"/>).
			                          &nbsp;</span>
			                        </td>
			                        <td width="5%">
			                      <c:choose>
			                      <c:when test="${vlhlistmail.valueListInfo.totalNumberOfPages > 1}">
			                        <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagefutureEGTSettingsTableId}"/>&nbsp;</vlh:paging>
			                      </c:when>
			                      <c:otherwise>
			                        &nbsp;
			                      </c:otherwise>
			                      </c:choose>
			                    </td>
			                      <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
			                    </tr>
			                  </table>
			                </td>
			              </tr>
			              <tr vAlign="top">
			                <td vAlign="top" align="center">
			                  <table summary="List of ACA Mail Correspondence sent on behalf of Veteran" rules="all" class="TableDisplay">
			                    <tr>
			                      <vlh:row bean="commsTemplate">

									<vlh:column titleKey="table.year" property="taxYear" attributes="align=\"left\" scope='col'" default="">
										<vlh:attribute name="scope">row</vlh:attribute>
			                          <esrcore:displayValue name="Correspondence" property="taxYear" nullText=""/>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsSubmitType" property="correctionInd" attributes="align=\"left\" scope='col'" default="">
			                         	<esrcore:displayValue name="Correspondence" property="correctionInd" nullText=""/>
			                        </vlh:column>

			                        <vlh:column titleKey="table.irsMailStatus" property="statusName" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayValue name="Correspondence" property="statusName" nullText=""/>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsMailType" property="formName" attributes="align=\"left\" scope='col'" default="">

			                          <a href="/esr/comms/commslog.do?methodName=View ACA Detail&amp;submissionId=<c:out value="${commsTemplate.entityKey.keyValue}"/>">
												${commsTemplate.formName}
										</a>
			                        </vlh:column>

			                        <vlh:column titleKey="table.viewpdf" property="correspondenceDocument" attributes="align=\"left\" scope='col'" default="">

			                          <c:choose>
			                          <c:when test="${commsTemplate.correspondenceDocument != null && commsTemplate.correspondenceDocument.entityKey != null}">
										<fw:link action="/commsACA.do?methodName=ACA&amp;submissionId=${commsTemplate.entityKey.keyValue}" module="/comms" target="_blank">
												<bean-el:message key="link.irs.viewdoc"/>
										</fw:link>
									 </c:when>
									 <c:otherwise>
									 	<bean-el:message key="table.irs.nopdf"/>
									 </c:otherwise>
									 </c:choose>
			                        </vlh:column>

			                         <vlh:column titleKey="table.irsMailStatusDate" property="statusDate" format="MM/dd/yyyy h:mm:ss a" attributes="align=\"left\" scope='col'" default="">
			                          <esrcore:displayDate name="Correspondence" dateProperty="statusDate" format="MM/dd/yyyy h:mm:ss a"/>
			                        </vlh:column>

					               <vlh:column titleKey="table.remail" property="effectiveDate" attributes="align=\"left\" scope='col'" default="">
			                           	<c:choose>
		                                  <c:when test="${canResubmit == true && commsTemplate.formName == 'ACA TAX FORM 1095B'}">
		                                    <fw:link action="/commslog.do?methodName=Remail ACA&amp;submissionId=${commsTemplate.entityKey.keyValue}">
												<bean-el:message key="link.irs.remail"/>
											</fw:link>
		                                  </c:when>
		                                  <c:otherwise>&nbsp;</c:otherwise>
                               			</c:choose>
			                        </vlh:column>
			                      </vlh:row>
			                    </tr>
			                  </table>
			                </td>
			               </tr>
			              </vlh:root>
			            </table>
			          </div>
			        </td>
			      </tr>
	            </c:otherwise>
	           </c:choose>

				</table>
			 <!-- module shell table body-->
	   </td>
	  </tr>

	 </table>
	 <!-- module shell table  -->
   </td>
</tr>
</table>
<!-- module shell -->

