<%@ page import="com.fenalco.utilities.lists.QuoteListViewShopKeeper"%>
<%@ page import="com.fenalco.utilities.lists.QuoteViewShopKeeper"%>
<%@ page import="com.fenalco.entities.User"%>
<%@ page import="com.fenalco.entities.DataAccess"%>
<%@ page import="com.fenalco.utilities.MessageBuilder"%>
<%@ page import="com.fenalco.entities.StoreList"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="java.util.Hashtable"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel='stylesheet' style='text/css' href='../css/tablas.css'>
<title>Detalle cotizaci&oacute;n</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#ffffff" background="../images/shopkeeper/general/fondo.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
	String helpId = "37";
%>
<table border="0" cellpadding="0" cellspacing="0" width="780">
    <%@ include file="encabezado.jsp" %>
</table>


<table width="760" border="0" cellspacing="0" cellpadding="0">
    

    <tr>
        <td width="155" valign="top">
			<%@ include file="menuminorista.jsp" %>
	</td>
        <td width='505' valign="top">
            <%
                String tittle = "Cotizaci&oacute;n";
            %>
            <%@ include file="/titulo.jsp" %>

			<table width="100%">
				<tr><td align="center">
				
                                    <%String message = ( String )request.getAttribute("message");
                                        if( message != null )
                                        {
                                            %>
                                            <%=message%>
                                            <%
                                        }      
                                    %>
                                    </td></tr>
                                    <tr><td>
                                    <!-- aqui va el listado -->
                                    <%
                                    QuoteViewShopKeeper view = (QuoteViewShopKeeper)request.getAttribute("view");


                                    %>
                                            <table width='100%'>
                                                

                                                <tr>
                                                    <td><b>Fecha </b></td><td><%=view.getQuoteDate()%></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Proveedor</b></td><td><%=view.getSupplierName()%></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Estado</b></td><td><%=view.getStatus()%></td>
                                                </tr>
                                                <tr>
                                                    <td colspan='2'><b>Productos</b></td>
                                                </tr>
                                                <tr>
                                                <td colspan='2'>
                                                    <table align="left">
                                                        <tr class='tableHeader'>
                                                            <!-- Encabezado del listado -->
                                                            <td align="center"><b>C&oacute;digo</b></td>
                                                            <td align="center"><b>Nombre</b></td>
                                                            <td align="center"><b>Categor&iacute;a</b></td>
                                                            <td align="center"><b>Cantidad</b></td>
                                                            <td align="center"><b>Precio</b></td>

                                                        </tr>
                                                        <% 

                                                        Object data = new Object();
                                                        String id="";
                                                        if(view != null)
                                                        {
                                                            while(view.move()){
                                                                int i = 0;
                                                               id = "";    
                                                        %>
                                                        <tr>
                                                                <% while((data=view.nextElement()) != null){

                                                                        i++;
                                                                        if(i==1){
                                                                            id = data.toString();
                                                                        }
                                                                        else{
                                                                %>              
                                                                            <td><%= data.toString() %></td>
                                                                <%
                                                                        }
                                                               }
                                                                %>
                                                        <!-- Columnas para las opciones -->

                                                        </tr>
                                                        
                                                        <% } 
                                                        }%>
                                                        <tr>
                                                            <td colspan='5'><hr></td>
                                                        </tr>    
                                                        <tr>
                                                            <td><b>Total</b> </td><td><%=view.getValue()%></td>
                                                        </tr>
                                                        <tr>
                                                        <td>
                                                             <form name='quote' action='/minorista/comprarcotizacion' method='POST' >   
                                                                <input type='hidden' name='id' value='<%=view.getId()%>' > 
                                                                <%
                                                                if(view.getStatus().equals("respondida"))
                                                                {
                                                                %>
                                                                <input type='submit' value='Comprar'>
                                                                <%
                                                                }
                                                                %>
                                                            </form>
                                                        </td>
                                                        </tr>

                                                    </table>
                                                </td>
                                                </tr>


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

<table width="760">
	<tr>
		<td><%@ include file="/piepagina.jsp" %></td>
	</tr>
</table>
</body>
</html>








