<% /****************************************************************************** * Copyright (c) 2000-2006 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. ******************************************************************************/ %><%@page session="true" contentType="text/plain;charset=UTF-8"%><%@ page import="com.edeal.frontline.FlContext" %><%@ page import="com.edeal.frontline.navigation.FlRequest" %><%@ page import="java.util.Vector" %><%@ page import="java.util.Hashtable" %><%@ page import="java.text.DecimalFormat" %><%@ page import="com.edeal.frontline.FlLocale" %><%@ page import="com.edeal.frontline.Utils" %><% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); boolean listOnly; try { listOnly = Boolean.valueOf(flRequest.getParameter("listOnly")).booleanValue(); } catch (Exception e) { listOnly = true; } DecimalFormat moneyFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.00;- #,##0.00"); DecimalFormat intFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0;- #,##0"); double totalPrice = 0; Vector prods = (Vector)flRequest.getAttribute("prods"); if (prods == null) { prods = new Vector(); } StringBuffer tableBuf = new StringBuffer(); // Construct our table tableBuf.append(""); if (prods.size() == 0) { tableBuf.append(""); } else { tableBuf.append(""); // Product rows for (int cnt = 0; cnt < prods.size(); ++cnt) { Hashtable row = (Hashtable)prods.elementAt(cnt); Double PrdPrice = (Double) row.get("PgePrdID:PrdPrice"); String PrdCode = (String)row.get("PgePrdID:PrdCode"); String PrdName = (String)row.get("PgePrdID:PrdName"); Integer PgeNombre = (Integer)row.get("PgeNombre"); double lineTotal = PrdPrice.doubleValue() * PgeNombre.doubleValue(); totalPrice += lineTotal; tableBuf.append(""); } // Total - headers tableBuf.append(""); tableBuf.append(""); tableBuf.append(""); } tableBuf.append("
"); tableBuf.append(Utils.getMessage(session, "L0001", true, "Aucune entrée disponible")); tableBuf.append("
"); tableBuf.append(Utils.getMessage(session, "F2000", true, "Code")); tableBuf.append(""); tableBuf.append(Utils.getMessage(session, "F203F", true, "Désignation")); tableBuf.append(""); tableBuf.append(Utils.getMessage(session, "F3024", true, "Qte")); tableBuf.append(""); tableBuf.append(Utils.getMessage(session, "F60B8", true, "Prix")); tableBuf.append(""); tableBuf.append(Utils.getMessage(session, "F1058", true, "Total")); tableBuf.append("
"); if (!listOnly) { tableBuf.append(" - "); tableBuf.append(" - "); } if (listOnly) { tableBuf.append(""); } tableBuf.append(PrdCode == null ? " " : Utils.formatToJavascript(PrdCode)); if (listOnly) { tableBuf.append(""); } tableBuf.append(""); tableBuf.append(PrdName == null ? " " : Utils.formatToJavascript(PrdName)); tableBuf.append(""); tableBuf.append(PgeNombre == null ? " " : intFormat.format(PgeNombre.intValue())); tableBuf.append(""); tableBuf.append(PrdPrice == null ? " " : moneyFormat.format(PrdPrice.doubleValue()) + " €"); tableBuf.append(""); tableBuf.append(lineTotal == 0 ? " " : moneyFormat.format(lineTotal) + " €"); tableBuf.append("
 
"); tableBuf.append(Utils.getMessage(session, "F1058", true, "Total") + " : "); tableBuf.append(""); tableBuf.append(moneyFormat.format(totalPrice) + " €"); tableBuf.append("
"); %>var f = document.getElementById('GroupEntriesTable'); f.innerHTML = '<%= tableBuf.toString() %>'; try { document.getElementById('productPriceTotal').innerHTML = '<%= moneyFormat.format(totalPrice) %> €'; } catch (error) { }