Edit C:\Windows\install\galaxie_p01_01-10\marketing\invoiceEntry\list_inectn_ajax.jsp
<%@page import="com.edeal.frontline.grid.GridData.GridCellContent"%> <% /****************************************************************************** * Copyright (c) 2000-2005 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. * * ******************************************************************************/ //**listAjax.jsp**// %><%@page session="true" import="com.edeal.frontline.*"%> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="java.util.Hashtable" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.grid.GridData" %> <%@ page import="com.edeal.frontline.grid.GridTag" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="com.edeal.frontline.grid.*" %> <%@ page import="com.edeal.frontline.grid.EdealGrid" %> <%@ page import="java.util.*" %> <%@page import="com.edeal.frontline.helper.ActorBaseHelper"%> <%@page import="com.edeal.frontline.helper.custom.ActorHelper"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %><% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); String id = (String)flRequest.getAttribute("IneID"); int unitsTtl = 0; float montantTtl = 0; try { montantTtl = ((Float)flRequest.getAttribute("montantTtl")).floatValue(); } catch (Exception e) { } try { unitsTtl = ((Integer)flRequest.getAttribute("unitsTtl")).intValue(); } catch (Exception e) { } DecimalFormat intFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0;- #,##0"); InvoiceEntryBean InvoiceEntry = new InvoiceEntryBean(id, context); int numUnits = 0; float IneUnitPrice = 0; try{ numUnits = InvoiceEntry.getIneNumUnits(); IneUnitPrice = InvoiceEntry.getIneUnitPrice(); } catch (FieldNotInitializedException ex) { } float amount = numUnits * IneUnitPrice; // Find out how many units are left with this invoice entry int categoriesToGo = 0; try { String[] ctnKeys2 = { "Sum" }; String query = "SELECT SUM(CtnNumUnits) from Categorization where CtnFactLn = " + Utils.formatToSQL(context, id); Vector resp = BasicBean.listSQL(context, ctnKeys2, query); Hashtable hash = (Hashtable) resp.firstElement(); categoriesToGo = ((Number)hash.get("Sum")).intValue(); } catch (Exception e) { } String code = flRequest.getRequestParameterOrAttribute("gridName"); GridData grid = (GridData)request.getAttribute(code); EdealGrid edealGrid=new EdealGrid(); edealGrid.setName(code); edealGrid.buildColumns(session, context, grid); String pEditMode=flRequest.getParameter("editmode"); boolean fUpdateMode=("true".equals(pEditMode)); DataDictionary dico = context.getDataDictionary(); String type = (String)flRequest.getAttribute("objSql"); if(grid.getNbRows()==0){ %> <fl:label code="L0001" label="Aucune entrée disponible "/> <%}else{%> <div id="grid-data" class="data"> <table > <thead> <tr> <% int formIndex=1; for (EdealGridColumn gridColumn: edealGrid.getColumns()) { if (!gridColumn.getDataType().equals(EdealGridColumn.DataType.PREVIEW)) { %> <%=gridColumn.getHeader(edealGrid.getJsGridName(), edealGrid.getName(), flRequest)%> <%} } %></tr> </thead> <tbody><% ArrayList<String> rowsId = grid.getRowsId(); //ArrayList<String> previewValue = new ArrayList(); boolean oddRow = false; ActorBean currentActor=ActorHelper.getSessionActor(session); BasicBean rowBean; for(int rowidx = 0; rowidx < grid.getData().length; rowidx++) { String id2 = ""; oddRow = !oddRow ; String objectID=""; if (rowsId != null && rowsId.size()>0 && rowsId.get(rowidx) != null) { objectID=rowsId.get(rowidx); id2 = " id=\"" + objectID + "\""; }%> <tr<%= id2 %> class="<%= (oddRow ? "even" : "odd") %> bean" tabindex="<%=rowidx%>"> <%Object[] row = grid.getData()[rowidx]; for (int colidx = 0; colidx < row.length; colidx++) { EdealGridColumn eGCol = edealGrid.getColumn(colidx);%> <td align="<%= eGCol.getAlignment() %>"><%= eGCol.format((GridCellContent)row[colidx]) %></td> <%} %></tr> <% } if (type!=null && request.getAttribute(type)!=null) { request.removeAttribute(type); } %></tbody> </table> </div> <%}%> <br/> <table class="container" cellpadding="0"> <tr> <td class="titreInterneSmalltabs"><fl:getMessage code="F1058" alt="Total"/></td> </tr> <tr class="ligne_separation_couleur"><td colspan="5"></td></tr> </table> <table class="container" cellpadding="1" style="width:50%" align="center"> <tr style="vertical-align: top"> <td style="width: 33%;text-align: center; white-space: nowrap;"> </td> <td class="dataLabel" style="width: 33%;text-align: center; white-space: nowrap;"> <fl:getMessage code="F60DB" alt="Quantité"/> </td> <td class="dataLabel" style="width: 34%;text-align: center; white-space: nowrap;"> <fl:getMessage code="L2009" alt="Budget"/> </td> </tr> <tr style="vertical-align: top"> <td class="dataLabel" style="width: 33%;text-align: center; white-space: nowrap; border-bottom: thin dashed #9EC6D0;"> <fl:getMessage code="F60DA" alt="Imputation"/> </td> <td id="ImpQuant" class="tabSimpleFdBleu dataValue" style="width: 33%;text-align: center; white-space: nowrap;"> <%= intFormat.format(unitsTtl) %> </td> <td id="ImpBudg" class="tabSimpleFdBleu dataValue" style="width: 34%;text-align: center; white-space: nowrap;"> <%= intFormat.format(montantTtl) %> € </td> </tr> <tr style="vertical-align: top"> <td class="dataLabel" style="width: 33%;text-align: center; white-space: nowrap; border-bottom: thin dashed #9EC6D0;"> <fl:getMessage code="L6339" alt="Reste à Imputer"/> </td> <td id="RestImp" class="tabSimpleFdBleu dataValue" style="width: 33%;text-align: center; white-space: nowrap;"> <%= intFormat.format(numUnits - unitsTtl) %> </td> <td id="RestBudg" class="tabSimpleFdBleu dataValue" style="width: 34%;text-align: center; white-space: nowrap;"> <%= intFormat.format(amount - montantTtl) %> € </td> </tr> <tr style="vertical-align: top"> <td class="dataLabel" style="width: 33%;text-align: center; white-space: nowrap;"> <fl:getMessage code="F1052" alt="Avancement"/> </td> <td colspan="2" id="Advance" class="tabSimpleFdBleu dataValue" style="width: 33%;text-align: center; white-space: nowrap;"> <%= intFormat.format(montantTtl / amount * 100) %> % </td> </tr> </table>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de