<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.fenalco.utilities.lists.ListView"%>
<%@ page import="com.fenalco.entities.User"%>
<%@ page import="com.fenalco.entities.Order"%>
<%@ page import="com.fenalco.entities.Store"%>
<%@ page import="com.fenalco.entities.DataAccess"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Enumeration"%>
<html>
<head>
<link rel='stylesheet' style='text/css' href='../css/tablas.css'>
<title>Orden de Compra</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!-- 

-->
<body bgcolor="#ffffff" background="../images/sysmanager/general/fondo.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<% int roleId = ((User)(request.getSession().getAttribute("user"))).getRoleId();   %>
<% Order order = (Order)request.getAttribute("order");%>
<table width="100%">
    <tr>
        <td>
            <%
                String tittle = "Detalle del Pedido";
            %>
            <%@ include file="/titulo.jsp" %>

			<table width="100%">
				<tr><td align="center"><%= request.getAttribute("message")%></td></tr>
				<tr>
                                    <td>&nbsp;</td>
				</tr>
				<form name="Order" method="post" action ="">
				<table align='center' width='80%'>
                                     <tr>
                                            <td>Proveedor:
                                            <%=order.getCompanyName()%></td>
                                            <td>Minorista:
                                            <%=Store.getCompanyName(order.getStoreId())%></td>
                                     </tr>
                                     <tr>
                                        <td>Fecha:
                                        <%=order.getDate()%></td>
                                        <td>Establecimiento:
                                        <%=order.getStoreName()%></td>
                                     </tr>
                                </table>
				<table align="center" cellspacing='6'>
                                        <tr>
                                            <td colspan='6'>&nbsp;</td>
                                        </tr>
                                        <tr>
						<!-- Encabezado del listado -->
						<td align="center">C&oacute;digo del Producto</td>
						<td align="center">Categor&iacute;a</td>
						<td align="center">Nombre del Producto</td>
						<td align="center">Cantidad</td>
						<td align="center">Precio</td>
					</tr>
                                        <% 
                                        ListView view = (ListView)request.getAttribute("view");
                                        String data;
                                            while(view.move()){
                                                    int i=0;
                                                    String id="";
                                                    
                                        %>
                                                    <tr>
                                                        <%while((data=(String)view.nextElement())!=null){%>
                                                            <%if(i==0){
                                                                id=data;
                                                              }else{
                                                                    if(i==5){
                                                        %>
                                                                <td><%=DataAccess.getCurrency(Double.parseDouble(data))%></td>
                                                        <%          }else{
                                                        %>
                                                                <td><%=data%></td>
                                                        <%          }
                                                              }      
                                                              i++;
                                                        }%>
                                                        <!--
                                                        Columnas para las opciones
                                                        -->
                                                    </tr>  
                                        <%}
                                        %>
                                            <tr>
                                                <td colspan='4'></td>
                                                <td><hr></td>
                                            </tr>
                                            <tr>
                                                <td colspan='3'></td>
                                                <td align="center">Total</td>
                                                <td><%=DataAccess.getCurrency(order.getValue())%></td>
                                            </tr>

                                </table>
				</form>
				</tr>
	</td>
    </tr>
</table>
</body>
</html>

