<%/****************************************************************************** * 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. ******************************************************************************/ %> <%@ page session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest"%> <%@ page import="com.edeal.frontline.FlContext"%> <%@ page import="com.edeal.frontline.Utils"%> <%@ page import="com.edeal.frontline.FieldNotInitializedException"%> <%@ page import="com.edeal.frontline.DataDictionary"%> <%@ page import="java.text.DecimalFormat"%> <%@ page import="java.util.Vector"%> <%@ page import="java.util.Iterator"%> <%@ page import="com.edeal.frontline.FlLocale"%> <%@ page import="java.util.Hashtable"%> <%@ page import="com.edeal.frontline.CampaignBean"%> <%@ page import="com.edeal.frontline.DepartmentBean"%> <%@ page import="java.util.Date"%> <%@ page import="com.edeal.frontline.ContributionBean"%> <%@ page import="com.edeal.frontline.CategorizationBean"%> <%@ page import="com.edeal.frontline.StageBean"%> <%@ page import="com.edeal.frontline.ExpenseCategoryBean"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> <% FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String id = null; try { id = Department.getID(); } catch (FieldNotInitializedException fnie) { } // Get the current fiscal year from the Année Fiscal reference table Vector yearRefList = dico.getRefList(session, "Anf", "Te2"); Vector tmpVector; Iterator it = yearRefList.iterator(); String refID = ""; String refVal = "N"; while (it.hasNext()) { tmpVector = (Vector) it.next(); refID = (String) tmpVector.get(0); refVal = (String) tmpVector.get(1); if (refVal.equalsIgnoreCase("O")) { break; } } String currFiscalYear = refVal.equals("N") ? "0" : dico.getRefCode( "Anf", "Te1", refID); String prevFiscalYear = "0"; try { Integer prevYear = new Integer( Integer.parseInt(currFiscalYear) - 1); prevFiscalYear = prevYear.toString(); } catch (NumberFormatException e) { } DecimalFormat intFormat = FlLocale.getInstance(session) .getDecimalFormat("#,##0;- #,##0"); DecimalFormat floatFormat = FlLocale.getInstance(session) .getDecimalFormat("#,##0.##;- #,##0.##"); float DptObjCA = 0; float DptCAPrev = 0; float DptBudgMktObj = 0; float DptBudgMktPrev = 0; try { DptObjCA = Department.getDptObjCA(); } catch (Exception e) { } try { DptCAPrev = Department.getDptCAPrev(); } catch (Exception e) { } try { DptBudgMktObj = Department.getDptBudgMktObj(); } catch (Exception e) { } try { DptBudgMktPrev = Department.getDptBudgMktPrev(); } catch (Exception e) { } %> " ou="<%= \"/read_department.fl?id=\" + id %>">
" nbPix="30"> <% float currBudgetP = 0; float prevBudgetP = 0; %> " visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 1\") %>"> "> <%float curEcart = DptObjCA - DptCAPrev; float curProg = 0; try { if (DptCAPrev != 0) curProg = curEcart / DptCAPrev; } catch (Exception e) { } %> <% curEcart = DptBudgMktObj - DptBudgMktPrev; String valToDisplay = ""; try { if(DptBudgMktObj == 0 && DptBudgMktPrev == 0){ valToDisplay = " "; } else if(DptBudgMktPrev == 0 && DptBudgMktObj != 0){ valToDisplay = "% "; } else { curProg = curEcart / DptBudgMktPrev; valToDisplay = floatFormat.format(curProg * 100) + " % "; } } catch (Exception e) { } %> <%float currYearMkt = 0; float prevYearMkt = 0; float DptPrtGrpe = 0; float DptPrtGrpePrev = 0; String finalDptPrtGrpe = ""; String finalDptPrtGrpePrev = ""; String finalDptPrtGrpePer = ""; String finalDptPrtGrpePrevPer = ""; try { DptPrtGrpe = Department.getDptPrtGrpe(); } catch (FieldNotInitializedException fnie) {} try { DptPrtGrpePrev = Department.getDptPrtGrpePrev(); } catch (FieldNotInitializedException fnie) {} if (Department.isDptPrtGrpeType()) { finalDptPrtGrpePer = floatFormat.format(DptPrtGrpe) + " %"; DptPrtGrpe = (DptPrtGrpe / 100) * DptBudgMktObj; } else { if (DptBudgMktObj != 0) finalDptPrtGrpePer += floatFormat.format(DptPrtGrpe / DptBudgMktObj * 100) + " %"; else finalDptPrtGrpePer += floatFormat.format(0) +" %"; } finalDptPrtGrpe += intFormat.format(DptPrtGrpe) + " €"; if (Department.isDptPrtGrpePrevType()) { finalDptPrtGrpePrevPer = floatFormat.format(DptPrtGrpePrev) + " %"; DptPrtGrpePrev = (DptPrtGrpePrev / 100) * DptBudgMktPrev; } else { if (DptBudgMktObj != 0) finalDptPrtGrpePrevPer += floatFormat.format(DptPrtGrpePrev / DptBudgMktObj * 100) + " %"; else finalDptPrtGrpePrevPer += floatFormat.format(0) + " %"; } finalDptPrtGrpePrev += intFormat.format(DptPrtGrpePrev) + " €"; float bugProgEcart = DptPrtGrpe - DptPrtGrpePrev; float bugProgPcg = 0; try { if (DptObjCA != 0) currYearMkt = DptBudgMktObj / DptObjCA; } catch (Exception e) { } try { if (DptCAPrev != 0) prevYearMkt = DptBudgMktPrev / DptCAPrev; } catch (Exception e) { } try { if (DptPrtGrpePrev != 0) bugProgPcg = (bugProgEcart) / DptPrtGrpePrev; } catch (Exception e) { } %> <%currBudgetP = DptBudgMktObj - DptPrtGrpe; prevBudgetP = DptBudgMktPrev - DptPrtGrpePrev; bugProgEcart = currBudgetP - prevBudgetP; bugProgPcg = 0; try { if (prevBudgetP != 0) bugProgPcg = (bugProgEcart) / prevBudgetP; } catch (Exception e) { } %>
<%=currFiscalYear%> <%=prevFiscalYear%>
<%=intFormat.format((int) DptObjCA)%> €  <%= intFormat.format((int) DptCAPrev)%> €  <%= (curProg != 0) ? floatFormat.format(curProg * 100) : "" %> %  <%=intFormat.format((int) curEcart)%> € 
<%=intFormat.format((int) DptBudgMktObj)%> €  <%=intFormat.format((int) DptBudgMktPrev)%> €  <%= valToDisplay %> <%=intFormat.format((int) curEcart)%> € 
<%= (currYearMkt != 0) ? floatFormat.format(currYearMkt * 100) : "" %> %  <%= (prevYearMkt != 0) ? floatFormat.format(prevYearMkt * 100) : "" %> % 
<%=finalDptPrtGrpe%>   <%=finalDptPrtGrpePrev%>   <%= (bugProgPcg != 0) ? floatFormat.format(bugProgPcg * 100) : ""%> %  <%=intFormat.format((int) bugProgEcart)%> € 
 (%)  <%= !(finalDptPrtGrpePer.equals("0 %")) ? finalDptPrtGrpePer : "0 %" %>   <%= !(finalDptPrtGrpePrevPer.equals("0 %")) ? finalDptPrtGrpePrevPer : "0 %" %>  
<%=intFormat.format((int) currBudgetP)%> €  <%=intFormat.format((int) prevBudgetP)%> €  <%= (bugProgPcg != 0) ? floatFormat.format(bugProgPcg * 100) : "0"%> %  <%=intFormat.format((int) bugProgEcart)%> € 
<% String pBudget = (String) flRequest.getAttribute("DeptBilanPrev_budgetTotal"); if (pBudget != null) { %> <%} %> <% String pBudgetPrev = (String) flRequest.getAttribute("DeptCpgPrev_budgetPrevu"); if (pBudgetPrev != null) { %> <%} %>
">
<%= Utils.formatToWeb(pBudget,false) %> € 
">
<%= Utils.formatToWeb(pBudgetPrev,false) %> € 
">
<% String currpBudget = (String) flRequest.getAttribute("DeptBilan_budgetTotal"); if (currpBudget != null) { %> <%} %> <% String currpBudgetPrev = (String) flRequest.getAttribute("DeptCpg_budgetPrevu"); if (currpBudgetPrev != null) { %> <%} %>
">
<%= Utils.formatToWeb(currpBudget,false) %> € 
">
<%= Utils.formatToWeb(currpBudgetPrev,false) %> € 
"/>
" visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 2\") %>"> " visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 3\") %>">