%@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){
%>
<%}else{%>
<%
int formIndex=1;
for (EdealGridColumn gridColumn: edealGrid.getColumns()) {
if (!gridColumn.getDataType().equals(EdealGridColumn.DataType.PREVIEW)) { %>
<%=gridColumn.getHeader(edealGrid.getJsGridName(), edealGrid.getName(), flRequest)%>
<%}
}
%>
<%
ArrayList rowsId = grid.getRowsId();
//ArrayList 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 + "\"";
}%>
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);%>
<%= eGCol.format((GridCellContent)row[colidx]) %> |
<%}
%>
<%
}
if (type!=null && request.getAttribute(type)!=null) {
request.removeAttribute(type);
}
%>
<%}%>
|
|
|
|
<%= intFormat.format(unitsTtl) %>
|
<%= intFormat.format(montantTtl) %> €
|
|
<%= intFormat.format(numUnits - unitsTtl) %>
|
<%= intFormat.format(amount - montantTtl) %> €
|
|
<%= intFormat.format(montantTtl / amount * 100) %> %
|