Edit C:\galaxie\deploy\Tomcat6\work\Catalina\localhost\galaxie\old\org\apache\jsp\sales\productOpportunity\prodOppsTable_005fajax_jsp.java
package org.apache.jsp.sales.productOpportunity; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import com.edeal.frontline.ProductBean; import com.edeal.frontline.DataDictionary; import com.edeal.frontline.FieldNotInitializedException; import com.edeal.frontline.FrontlineException; import com.edeal.frontline.AccessDeniedException; import com.edeal.frontline.OpportunityBean; import com.edeal.frontline.FlContext; import com.edeal.frontline.navigation.FlRequest; import java.util.Vector; import java.util.Hashtable; import java.text.DecimalFormat; import com.edeal.frontline.FlLocale; import com.edeal.frontline.Utils; public final class prodOppsTable_005fajax_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); private static java.util.List _jspx_dependants; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.AnnotationProcessor _jsp_annotationprocessor; public Object getDependants() { return _jspx_dependants; } public void _jspInit() { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName()); } public void _jspDestroy() { } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/plain;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); /****************************************************************************** * 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. ******************************************************************************/ final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); boolean listOnly; try { listOnly = Boolean.valueOf(flRequest.getParameter("listOnly")).booleanValue(); } catch (Exception e) { listOnly = true; } DecimalFormat unitPriceFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.##"); DecimalFormat moneyFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.##"); DecimalFormat intFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0;- #,##0"); DecimalFormat doubleFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.##;- #,##0.##"); double totalGross = 0; double totalPrice = 0; double Remise = 0; double totalDiscountM = 0; double totalTVA = 0; double totalTPF = 0; double totalHT = 0; double netApayer = 0; boolean presenceArt = false; Vector prods = (Vector)flRequest.getAttribute("products"); String oppID = (String)flRequest.getAttribute("pOppID"); OpportunityBean opp = new OpportunityBean(oppID, context); double acompte = 0; try{ acompte = (Double)opp.getCustomProperty("OppAcompte_"); }catch(FieldNotInitializedException fe){ } StringBuffer tableBuf = new StringBuffer(); // Construct our table tableBuf.append("<div id=\"grid-data\" class=\"data\">"); tableBuf.append("<table cellpadding=\"0\" cellspacing=\"0\">"); if (prods.size() == 0) { tableBuf.append("<tr valign=\\\"top\\\"><td colspan=\\\"5\\\" style=\\\"width: 100%;\\\"><span class=\\\"dataLabel\\\">"); tableBuf.append(Utils.getMessage(session, "L0001", true, "Aucune entrée disponible")); tableBuf.append("</span></td></tr>"); } else { String height = null; try{ height = flRequest.getContext().getContextParameter("Devis.Thumbnail.Height"); } catch (FrontlineException fex) { height = "50"; } String width = null; try{ width = flRequest.getContext().getContextParameter("Devis.Thumbnail.Width"); } catch (FrontlineException fex) { width = "80"; } tableBuf.append("<thead><tr valign=\"top\">"); if (!listOnly) { tableBuf.append("<th style=\\\"width: 1%;\\\"> </th>"); } tableBuf.append("<th>"); tableBuf.append(Utils.getMessage(session, "F600A", true, "Image")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "F2000", true, "Code")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "F203F", true, "Désignation")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "F3023", true, "P. U. HT")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "LF18A", true, "Quantité facturée")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "F3025", true, "Remise sur P.U")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF132", true, "P. U. HT Après Remise")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF134", true, "Montant HT")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF130", true, "TVA à appliquer")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF140", true, "Montant TVA")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF1F0", true, "TPF à appliquer")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF1F1", true, "Montant TPF")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "F3026", true, "Prix net")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "", true, "Code TVA")); tableBuf.append("</th></tr>"); // Product rows boolean doColor = false; for (int cnt = 0; cnt < prods.size(); ++cnt) { Hashtable row = (Hashtable)prods.elementAt(cnt); presenceArt = true; // récup image du produit String imgPrdID = null; imgPrdID = (String)row.get("ProPrdID:PrdPicID"); Double ProPrice = (Double) row.get("ProPrice"); if (ProPrice != null ) { totalPrice += ProPrice.doubleValue(); } Integer ProQuantity = (Integer) row.get("ProQuantity"); Double ProUnitPrice = (Double)row.get("ProUnitPrice"); Double ProMontantHTrem_ = (Double)row.get("ProMontantHTrem_"); Double ProMontantTva_ = (Double)row.get("ProMontantTva_"); Double ProMontantTpf_ = (Double)row.get("ProMontantTpf_"); Double ProUnitHTrem_ = (Double)row.get("ProUnitHTrem_"); try { totalGross += ProQuantity.intValue() * ProUnitPrice.doubleValue(); } catch (NullPointerException e) { } String ProRemise_ =(String)row.get("ProRemise_:Val"); String ProPrdTva_ =(String)row.get("ProPrdTva_:Val"); String ProPrdTva_RefV = (String)row.get("ProPrdTva_"); String codeTVA = ProPrdTva_RefV != null ? dico.getRefCode("ProPrdTva_", ProPrdTva_RefV) : ""; String ProPrdTaxeParafiscale_ =(String)row.get("ProPrdTaxeParafiscale_:Val"); // on additionne les montants de remise de chaque produit if (ProRemise_ != null && ProUnitHTrem_ != null) { Remise = ( ProUnitPrice.doubleValue() - ProUnitHTrem_.doubleValue() ) * ProQuantity ; totalDiscountM += Remise; } // on additionne les montants TVA de chaque produit if (ProMontantTva_ != null ) { totalTVA += ProMontantTva_.doubleValue(); } // on additionne les montants TVA de chaque produit if (ProMontantTpf_ != null ) { totalTPF += ProMontantTpf_.doubleValue(); } // on additionne les montants HT de chaque produit if (ProMontantHTrem_ != null ) { totalHT += ProMontantHTrem_.doubleValue(); } netApayer = totalPrice-acompte; String PrdCode = (String)row.get("ProPrdID:PrdCode"); String PrdDesignation = (String)row.get("ProDesignation"); String prdid = (String)row.get("ProPrdID"); try{ String prdnamelng_ = (String)ProductBean.lookup(context, "PrdNamelng_", prdid); PrdDesignation = (String)dico.getRefDisp(session, "Rd_", "Te1", prdnamelng_); }catch(Exception e){ logger.warn(e.getMessage()); } tableBuf.append("<tr valign=\\\"top\\\" class=\\\""+ (doColor ? "tabSimpleFdBlanc" : "tabSimpleFdBleu") +"\\\">"); if (!listOnly) { tableBuf.append("<td><a href=\\\"javascript:doEdit(\\\'" + row.get("ProID") + "\\\')\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/zoom.gif\\\" class=\\\"icon\\\" style=\\\"padding-left: 0px;\\\"></a> "); tableBuf.append("<a href=\\\"javascript:doDelete(\\\'" + row.get("ProID") + "\\\')\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/supprimer.gif\\\" class=\\\"icon\\\"></a></td>"); } if (imgPrdID != null) { tableBuf.append("<td nowrap style=\\\"width: 10%;text-align:left;\\\">"); tableBuf.append("<img alt=\"\" src=\"" + (String) flRequest.getContextPath() + "/download?id=" + imgPrdID + "\" height=\"" + height + "\" width=\"" + width + "\"/>"); tableBuf.append("</td>"); } else { tableBuf.append("<td nowrap style=\\\"width: 10%;text-align:left;\\\">"); tableBuf.append("</td>"); } tableBuf.append("<td nowrap>"); if (listOnly) { tableBuf.append("<a href=\\\"" + context.getContextName() + "/read_product.fl?id=" + row.get("ProPrdID") + "\\\">"); } tableBuf.append(PrdCode == null ? " " : Utils.formatToJavascript(PrdCode)); if (listOnly) { tableBuf.append("</a>"); } tableBuf.append("</td><td nowrap style=\\\"width: 20%;text-align:left;\\\">"); tableBuf.append(PrdDesignation == null ? " " : Utils.formatToJavascript(PrdDesignation)); tableBuf.append("</td><td nowrap style=\\\"width: 7%;text-align: right;\\\">"); tableBuf.append(ProUnitPrice == null ? " " : unitPriceFormat.format(ProUnitPrice.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 7%;text-align: right;\\\">"); tableBuf.append(ProQuantity == null ? " " : intFormat.format(ProQuantity.intValue())); tableBuf.append("</td><td nowrap style=\\\"width: 10%;text-align:left;\\\">"); tableBuf.append(ProRemise_ == null ? " " : Utils.formatToJavascript(ProRemise_)); tableBuf.append("</td><td nowrap style=\\\"width: 7%;text-align: right;\\\">"); tableBuf.append( ProUnitHTrem_== null ? " " : unitPriceFormat.format(ProUnitHTrem_.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 8%;text-align: right;\\\">"); tableBuf.append( ProMontantHTrem_ == null ? " " : unitPriceFormat.format(ProMontantHTrem_.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 8%;text-align:left;\\\">"); tableBuf.append(ProPrdTva_ == null ? " " : Utils.formatToJavascript(ProPrdTva_)); tableBuf.append("</td><td nowrap style=\\\"width: 6%;text-align: right;\\\">"); tableBuf.append(ProMontantTva_ == null ? " " : unitPriceFormat.format(ProMontantTva_.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 10%;text-align:left;\\\">"); tableBuf.append(ProPrdTaxeParafiscale_ == null ? " " : Utils.formatToJavascript(ProPrdTaxeParafiscale_)); tableBuf.append("</td><td nowrap style=\\\"width: 6%;text-align: right;\\\">"); tableBuf.append(ProMontantTpf_ == null ? " " : unitPriceFormat.format(ProMontantTpf_.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 10%;text-align: right;\\\">"); tableBuf.append(ProPrice == null ? " " : moneyFormat.format(ProPrice.doubleValue()) + " €"); tableBuf.append("</td><td nowrap style=\\\"width: 8%;text-align:left;\\\">"); tableBuf.append(ProPrdTva_ == null ? " " : Utils.formatToJavascript(codeTVA)); tableBuf.append("</td></tr>"); doColor = !doColor; } // Total - headers tableBuf.append("<tr class=\\\"ligne_separation\\\" valign=\\\"top\\\" style=\\\"border:0px;\\\"><td colspan=\\\"7\\\" style=\\\"border:0px;\\\"> </td></tr>"); tableBuf.append("<tr style=\\\"vertical-align: top\\\">"); if (!listOnly) { tableBuf.append("<th colspan=\\\"3\\\" style=\\\"text-align: right; border: 0px;\\\"> </th>"); } else { tableBuf.append("<th colspan=\\\"3\\\" style=\\\"text-align: right; border: 0px;\\\"> </th>"); } tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF13D", true, "Acompte")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "L3041", true, "Remise totale")); tableBuf.append("</th><th colspan=\\\"3\\\">"); tableBuf.append(Utils.getMessage(session, "LF18B", true, "Total HT")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "LF18C", true, "Total TVA")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "LF18E", true, "Total TPF")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "LF18D", true, "Total TTC")); tableBuf.append("</th><th>"); tableBuf.append(Utils.getMessage(session, "FF13E", true, "NET à Payer")); tableBuf.append("</th></tr>"); tableBuf.append("<tr style=\\\"vertical-align: top;border: 0px;\\\" class=\\\"tabSimpleFdBleu\\\" valign=\\\"top\\\">"); if (!listOnly) { tableBuf.append("<td colspan=\\\"3\\\" class=\\\"headerDataGrid\\\" style=\\\"text-align: right;background-color: #fff;border: 0px;\\\">"); } else { tableBuf.append("<td colspan=\\\"3\\\" class=\\\"headerDataGrid\\\" style=\\\"text-align: right;background-color: #fff;border: 0px;\\\">"); } tableBuf.append(Utils.getMessage(session, "F1058", true, "Total") + " : "); tableBuf.append("</td><td style=\\\"text-align: right;\\\">"); tableBuf.append(moneyFormat.format(acompte) + " €"); tableBuf.append("</td><td style=\\\"text-align: right;\\\">"); tableBuf.append(moneyFormat.format(totalDiscountM) + " €"); tableBuf.append("</td><td colspan=\\\"3\\\"style=\\\"text-align: right;;\\\">"); tableBuf.append(moneyFormat.format(totalHT) + " €"); tableBuf.append("</td><td style=\\\"text-align: right;;\\\">"); tableBuf.append(moneyFormat.format(totalTVA) + " €"); tableBuf.append("</td><td style=\\\"text-align: right;;\\\">"); tableBuf.append(moneyFormat.format(totalTPF) + " €"); tableBuf.append("</td><td style=\\\"text-align: right;\\\">"); tableBuf.append(moneyFormat.format(totalPrice) + " €"); tableBuf.append("</td><td style=\\\"text-align: right;;\\\">"); tableBuf.append(moneyFormat.format(netApayer) + " €"); tableBuf.append("</td></tr></thead>"); } tableBuf.append("</table>"); try{ opp.setCustomProperty("OppNetApayer_", netApayer); opp.setCustomProperty("OppTotalHT_", totalHT); opp.setCustomProperty("OppTotalTVA_", totalTVA); opp.setCustomProperty("OppTotalTTC_", totalPrice); opp.setCustomProperty("OppTotalTPF_", totalTPF); opp.save(); }catch(AccessDeniedException ae){ }catch(FrontlineException fe){ } out.write("var f = document.getElementById('ProdOppTable');\n"); out.write("f.innerHTML = '"); out.print( tableBuf.toString() ); out.write("';\n"); out.write("\t"); if(presenceArt) { out.write("\n"); out.write("\tdocument.forms[0].presenceArticles.value ='true';\n"); out.write("\t"); } out.write("\n"); out.write("try {\n"); out.write("\tdocument.forms[0].total.value = '"); out.print( moneyFormat.format(totalPrice) ); out.write("';\n"); out.write("\tdocument.forms[0].totalHT.value = '"); out.print( moneyFormat.format(totalHT) ); out.write("';\n"); out.write("\tdocument.forms[0].totalTVA.value = '"); out.print( moneyFormat.format(totalTVA) ); out.write("';\n"); out.write("\tdocument.forms[0].totalTPF.value = '"); out.print( moneyFormat.format(totalTPF) ); out.write("';\n"); out.write("} catch (error) {\n"); out.write("}\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else log(t.getMessage(), t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de