Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\department\read.jsp
<%/****************************************************************************** * 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"%> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/smalltabs_css.jsp"> <jsp:useBean class="com.edeal.frontline.DepartmentBean" id="Department" scope="request" /><% 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) { } %> <style type="text/css"> </style> <script language="javascript"> function refreshBilan() { _grid__DeptBilan_js_.render(); _grid__DEPTCPG_js_.render(); _grid__DeptStg_js_.render(); } function refreshBilanPrev() { _grid__DeptBilanPrev_js_.render(); _grid__DEPTCPGPREV_js_.render(); _grid__DeptStgPrev_js_.render(); _grid__DeptStg_js_.render(); } </script> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L6435\", false, true, \"Département\") %>" ou="<%= \"/read_department.fl?id=\" + id %>"> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <fl:getProperty name="Department" property="DptTitle" alt="" /> </td> </tr> <tr class="ligne_separation"> <td colspan="5"></td> </tr> <tr> <td class="column3"> <table class="container" cellpadding="0"> <fl:fieldRead property="DptCode" /> </table> </td> <td> <div class="separation"></div> </td> <td class="column3"> <table class="container" cellpadding="0"> <fl:fieldRead property="DptType" /> </table> </td> <td> <div class="separation"></div> </td> <td class="column3"> <table class="container" cellpadding="0"> <fl:fieldRead property="DptEnt" /> </table> </td> </tr> </table> <fl:notes name="DptNotes" title="<%= Utils.getMessage(session, \"F2024\", \"Notes\") %>" nbPix="30"> <fl:getProperty name="Department" property="DptNotes" alt="" /> </fl:notes> <% float currBudgetP = 0; float prevBudgetP = 0; %> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="DptRead"> <fl:sTab id="DEPARTMENT1" title="<%= context.getAutoDisplayManager().getTitle(session, \"Department\", \"Department 1\") %>" visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 1\") %>"> <fl:autodisplay name="Department" zone="Department 1" /> </fl:sTab> <fl:sTab id="BUDGET" title="<%= Utils.getMessage(session, \"L2009\", false, true, \"Budget\") %>"> <table class="container" cellpadding="0" width="100%"> <tr> <td class="headerDataGrid borderLineOne" style="width: 20%;"></td> <td class="headerDataGrid borderLineOne" style="width: 20%;"> <%=currFiscalYear%> </td> <td class="headerDataGrid borderLineOne" style="width: 20%;"> <%=prevFiscalYear%> </td> <td class="headerDataGrid borderLineOne" style="width: 20%;"> <fl:getMessage code="L6338" alt="Progression" /> </td> <td class="headerDataGrid borderLineOne" style="width: 20%;"> <fl:getMessage code="L200A" alt="Ecart" /> </td> </tr> <%float curEcart = DptObjCA - DptCAPrev; float curProg = 0; try { if (DptCAPrev != 0) curProg = curEcart / DptCAPrev; } catch (Exception e) { } %> <tr class="tabSimpleFdBleu"> <td style="width: 20%" class="dataLabel borderLineOne"> <fl:getMessage code="L61CC" alt="Chiffre d'affaire" /> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) DptObjCA)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= intFormat.format((int) DptCAPrev)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= (curProg != 0) ? floatFormat.format(curProg * 100) : "" %> % </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) curEcart)%> € </td> </tr> <% 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) { } %> <tr class="tabSimpleFdBlanc"> <td class="dataLabel borderLineOne" style=" width: 20%"> <fl:getMessage code="L6341" alt="Budget marketing" /> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) DptBudgMktObj)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) DptBudgMktPrev)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= valToDisplay %> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) curEcart)%> € </td> </tr> <%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) { } %> <tr class="tabSimpleFdBleu"> <td style="width: 20%" class="dataLabel borderLineOne"> <fl:getMessage code="L6342" alt="Mkt/CA" /> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= (currYearMkt != 0) ? floatFormat.format(currYearMkt * 100) : "" %> % </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= (prevYearMkt != 0) ? floatFormat.format(prevYearMkt * 100) : "" %> % </td> <td style="text-align:right ; width: 20%" class="dataLabel borderLineOne"></td> <td style="text-align:right ; width: 20%" class="dataLabel borderLineOne"></td> </tr> <tr class="tabSimpleFdBlanc"> <td class="dataLabel borderLineOne" style=" width: 20%"> <fl:getMessage code="L6343" alt="Parte groupe" /> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=finalDptPrtGrpe%> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=finalDptPrtGrpePrev%> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= (bugProgPcg != 0) ? floatFormat.format(bugProgPcg * 100) : ""%> % </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) bugProgEcart)%> € </td> </tr> <tr class="tabSimpleFdBleu"> <td style="width: 20%" class="dataLabel borderLineOne" nowrap="true"> <fl:getMessage code="L6343" alt="Parte group" /> (%) </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= !(finalDptPrtGrpePer.equals("0 %")) ? finalDptPrtGrpePer : "0 %" %> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= !(finalDptPrtGrpePrevPer.equals("0 %")) ? finalDptPrtGrpePrevPer : "0 %" %> </td> <td style="text-align:right ; width: 20%" class="dataLabel borderLineOne"></td> <td style="text-align:right ;width: 20%" class="dataLabel borderLineOne"></td> </tr> <%currBudgetP = DptBudgMktObj - DptPrtGrpe; prevBudgetP = DptBudgMktPrev - DptPrtGrpePrev; bugProgEcart = currBudgetP - prevBudgetP; bugProgPcg = 0; try { if (prevBudgetP != 0) bugProgPcg = (bugProgEcart) / prevBudgetP; } catch (Exception e) { } %> <tr class="tabSimpleFdBlanc"> <td style=" width: 20%" class="dataLabel borderLineOne"> <fl:getMessage code="L6344" alt="Budget propre" /> </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) currBudgetP)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) prevBudgetP)%> € </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%= (bugProgPcg != 0) ? floatFormat.format(bugProgPcg * 100) : "0"%> % </td> <td style="text-align:right ; width: 20%" class="dataValue borderLineOne"> <%=intFormat.format((int) bugProgEcart)%> € </td> </tr> </table> </fl:sTab> <fl:sTab id="prevBILAN" title="<%= prevFiscalYear %>" onselect="refreshBilanPrev();"> <table class="container" cellpadding="0"> <tr> <td class="titrePartie" colspan="2"> <fl:getMessage code="F60E8" alt="Bilan inter-département" /> </td> </tr> <tr class="ligne_separation_couleur"> <td colspan="2"></td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="noPaddingLeft" colspan="2"> <div style="height:100%;overflow:auto"> <fl:grid height="100px" name="DeptBilanPrev" ajaxUrl="<%= \"/list_custom_prevdeptbilan_ajax.fl?anneeFiscal=\" + prevFiscalYear + \"&budgetPropre=\"+ prevBudgetP +\"&id=\"+ id %>"> <fl:gridColumn pos="0" style="text-align : right"></fl:gridColumn> <fl:gridColumn pos="1" style="text-align : right" posttext="€"></fl:gridColumn> <fl:gridColumn pos="2" style="text-align : right" posttext="€"></fl:gridColumn> <fl:gridColumn pos="3" style="text-align : right" posttext="€"></fl:gridColumn> </fl:grid> </div> </td> </tr> <% String pBudget = (String) flRequest.getAttribute("DeptBilanPrev_budgetTotal"); if (pBudget != null) { %> <tr> <td class="headerDataGrid borderLineOne" style="width: 75%; text-align: right ;border-right: 1px dashed #9EC6D0; border-bottom: 1px dashed #9EC6D0;"> <fl:getMessage code="L6348" alt="Budget total" /> </td> <td style="text-align:right ; width: 25%" class="dataValue borderLineOne"> <%= Utils.formatToWeb(pBudget,false) %> € </td> </tr> <%} %> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="titrePartie"> <fl:getMessage code="L6035" alt="Campagnes" /> </td> </tr> <tr class="ligne_separation_couleur"> <td></td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="noPaddingLeft"> <div style="height:100%;overflow:auto"> <fl:grid height="100px" name="DEPTCPGPREV" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=DEPTCPG&CpgYear=\" + dico.getRefIdByCode(\"Anf\", \"Te1\", prevFiscalYear) + \"&budgetPropre=\"+ prevBudgetP +\"&CpgDept=\"+ id %>"> <fl:gridColumn pos="0" style="text-align : left" width="40%"> </fl:gridColumn> <fl:gridColumn pos="1" style="text-align : right" width="15%"></fl:gridColumn> <fl:gridColumn pos="2" style="text-align : right" width="15%"></fl:gridColumn> <fl:gridColumn pos="3" style="text-align : right" width="15%"></fl:gridColumn> <fl:gridColumn pos="4" style="text-align : right" width="15%" posttext="€"></fl:gridColumn> </fl:grid> </div> </td> </tr> <% String pBudgetPrev = (String) flRequest.getAttribute("DeptCpgPrev_budgetPrevu"); if (pBudgetPrev != null) { %> <tr> <td class="headerDataGrid borderLineOne" style="width: 75%; text-align: right ;border-right: 1px dashed #9EC6D0; border-bottom: 1px dashed #9EC6D0;"> <fl:getMessage code="L6349" alt="Total prevu"/> </td> <td style="text-align:right ; width: 25%" class="dataValue borderLineOne"> <%= Utils.formatToWeb(pBudgetPrev,false) %> € </td> </tr> <%} %> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="noPaddingLeft"> <fl:grid height="50" name="DeptStgPrev" ajaxUrl="<%= \"/list_custom_prevdeptstg_ajax.fl?anneeFiscal=\" + prevFiscalYear + \"&budgetPropre=\"+ prevBudgetP +\"&id=\"+ id %>"> <fl:gridColumn pos="0" style="text-align : right" width="85%" posttext="€"></fl:gridColumn> <fl:gridColumn pos="1" style="text-align : right" width="15%" posttext="%"></fl:gridColumn> </fl:grid> </td> </tr> </table> </fl:sTab> <fl:sTab id="currBILAN" title="<%= currFiscalYear %>" onselect="refreshBilan();"> <table class="container" cellpadding="0"> <tr> <td class="titrePartie"> <fl:getMessage code="F60E8" alt="Bilan inter-département" /> </td> </tr> <tr class="ligne_separation_couleur"> <td></td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="noPaddingLeft"> <div style="height:100%;overflow:auto"> <fl:grid height="150px" name="DeptBilan" ajaxUrl="<%= \"/list_custom_deptbilan_ajax.fl?anneeFiscal=\" + currFiscalYear + \"&budgetPropre=\"+ currBudgetP +\"&id=\"+ id %>"> <fl:gridColumn pos="0" style="text-align : left" width="40%"> </fl:gridColumn> <fl:gridColumn pos="1" style="text-align : right" width="20%" posttext="€"></fl:gridColumn> <fl:gridColumn pos="2" style="text-align : right" width="20%" posttext="€"></fl:gridColumn> <fl:gridColumn pos="3" style="text-align : right" width="20%" posttext="€"></fl:gridColumn> </fl:grid> </div> </td> </tr> <% String currpBudget = (String) flRequest.getAttribute("DeptBilan_budgetTotal"); if (currpBudget != null) { %> <tr> <td class="headerDataGrid borderLineOne" style="width: 75%; text-align: right ;border-right: 1px dashed #9EC6D0; border-bottom: 1px dashed #9EC6D0;"> <fl:getMessage code="L6348" alt="Budget total" /> </td> <td style="text-align:right ; width: 25%" class="dataValue borderLineOne"> <%= Utils.formatToWeb(currpBudget,false) %> € </td> </tr> <%} %> <tr> <td class="titrePartie"> <fl:getMessage code="L6035" alt="Campagnes" /> </td> </tr> <tr class="ligne_separation_couleur"> <td></td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="noPaddingLeft"> <div style="height:100%;overflow:auto"> <fl:grid height="100px" width="100%" name="DEPTCPG" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=DEPTCPG&CpgYear=\" + dico.getRefIdByCode(\"Anf\", \"Te1\", currFiscalYear) + \"&budgetPropre=\"+ currBudgetP +\"&CpgDept=\"+ id %>"> </fl:grid> </div> </td> </tr> <% String currpBudgetPrev = (String) flRequest.getAttribute("DeptCpg_budgetPrevu"); if (currpBudgetPrev != null) { %> <tr> <td class="headerDataGrid borderLineOne" style="width: 100%; text-align: right ;border-right: 1px dashed #9EC6D0; border-bottom: 1px dashed #9EC6D0;"> <fl:getMessage code="L6349" alt="Total prevu"/> </td> <td style="text-align:right ; width: 25%" class="dataValue borderLineOne"> <%= Utils.formatToWeb(currpBudgetPrev,false) %> € </td> </tr> <%} %> <tr> <td class="noPaddingLeft"> <div style="height:100%;overflow:auto"> <fl:grid height="50px" width="100%" name="DeptStg" ajaxUrl="<%= \"/list_custom_deptstg_ajax.fl?anneeFiscal=\" + prevFiscalYear + \"&budgetPropre=\"+ prevBudgetP +\"&id=\"+ id %>"/> </div> </td> </tr> </table> </fl:sTab> <fl:sTab id="DEPARTMENT2" title="<%= context.getAutoDisplayManager().getTitle(session, \"Department\", \"Department 2\") %>" visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 2\") %>"> <fl:autodisplay name="Department" zone="Department 2" /> </fl:sTab> <fl:sTab id="DEPARTMENT3" title="<%= context.getAutoDisplayManager().getTitle(session, \"Department\", \"Department 3\") %>" visible="<%= context.getAutoDisplayManager().hasEntry(\"Department\", \"Department 3\") %>"> <fl:autodisplay name="Department" zone="Department 3" /> </fl:sTab> </fl:smallTabs> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de