<% /****************************************************************************** * 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.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="java.util.List" %> <%@ page import="com.edeal.frontline.FlLocale" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.SalesInvestBean" %> <%@ page import="com.edeal.frontline.PersonBean" %> <%@ page import="com.edeal.frontline.EnterpriseBean" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <%@taglib uri="http://www.e-deal.com/taglib/ft" prefix="ft" %> <% 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(); DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("#,##0.00"); String id = null; try { id = Opportunity.getID(); //flRequest.getSession().setAttribute("oppID",id); } catch (FieldNotInitializedException e) { } String oppStoID = null; try { oppStoID = Opportunity.getOppStoID(); } catch (FieldNotInitializedException e) { } double oppNetApayer_ = 0; try{ oppNetApayer_ = (Double)Opportunity.getCustomProperty("OppNetApayer_"); }catch(FieldNotInitializedException fe){ } String oppEntID = null; try { oppEntID = Opportunity.getOppEntID(); } catch (FieldNotInitializedException e) { } // on récupère l'iD du Fournissuer String oppBizProviderID = null; try { oppBizProviderID = Opportunity.getOppBizProviderID(); } catch (FieldNotInitializedException e) { } String oppBillTiersID_ = null; try { oppBillTiersID_ = (String)Opportunity.getCustomProperty("OppBillTiersID_"); } catch (FieldNotInitializedException e) { } String enjPond = ""; try { double stake = Opportunity.getOppStake(); Double prob = (Double)dico.getRefDisp(session, "Opb", "Nu1", Opportunity.getOppOpbID()); double enjEurPond = (double)(stake * prob.doubleValue()) / 100; enjPond = df.format(enjEurPond); } catch (FieldNotInitializedException e) { } // Détecter statut de l'opportunité String statutID = null;; try { statutID = Opportunity.getOppStoID(); } catch (FieldNotInitializedException e) { statutID = ""; } // ramener les ids des 5 statuts de l'opportunité String devisStateID = null; String devrefStateID = null; String commandeStateID = null; String factureStateID = null; String besoinStateID = null; try { devisStateID = dico.getRefIdByCode("Sto", "Te1", "DEV"); devrefStateID = dico.getRefIdByCode("Sto", "Te1", "DEVREF"); commandeStateID = dico.getRefIdByCode("Sto", "Te1", "ORD"); factureStateID = dico.getRefIdByCode("Sto", "Te1", "FAC"); besoinStateID = dico.getRefIdByCode("Sto", "Te1", "NEED"); } catch (Exception e) { devisStateID = ""; devrefStateID = ""; commandeStateID = ""; factureStateID = ""; besoinStateID = ""; } String salesModel = context.getContextParameter("SalesModel"); boolean isB2C = "B2C".equalsIgnoreCase(salesModel); String titreOnglet = ""; String titrePage = ""; List cptID = (List)flRequest.getAttribute("cptIDs"); List cptName = (List)flRequest.getAttribute("cptNames"); if(statutID.equalsIgnoreCase(devisStateID)) { titreOnglet = Utils.getMessage(session, "LF078", "Détail devis"); titrePage = Utils.getMessage(session, "L653F", "Devis"); } else if(statutID.equalsIgnoreCase(commandeStateID)) { titreOnglet = Utils.getMessage(session, "LF077", "Détail commande"); titrePage = Utils.getMessage(session, "LF035", "Commande"); } else if(statutID.equalsIgnoreCase(factureStateID)) { titreOnglet = Utils.getMessage(session, "LF074", "Détail facture"); titrePage = Utils.getMessage(session, "F60D4", "Facture"); } else { titreOnglet = Utils.getMessage(session, "LF079", "Détail opportunité"); titrePage = Utils.getMessage(session, "L3025", "Opportunité"); } %> ">
<% if(statutID.equalsIgnoreCase(devisStateID)) { %> <%} else if(statutID.equalsIgnoreCase(commandeStateID)) { %> <%} else if(statutID.equalsIgnoreCase(factureStateID)) { %> <%} %>
<%if(statutID.equalsIgnoreCase(besoinStateID)) {%> <%} if(statutID.equalsIgnoreCase(devisStateID) || statutID.equalsIgnoreCase(commandeStateID)) { if(statutID.equalsIgnoreCase(devisStateID)) {%> <%} else {%> <%} %> <%if(statutID.equalsIgnoreCase(devisStateID)) {%> " alt=" "/> <%} else {%> " alt=" "/> <%} %> <% if(oppEntID != null){ EnterpriseBean entClient = new EnterpriseBean(oppEntID, context); String phone = ""; try { phone = entClient.getEntPhone();; } catch (FieldNotInitializedException e) {} String mail = ""; try { mail = (String)entClient.getCustomProperty("EntMail_"); } catch (FieldNotInitializedException e) {} %> <% } if(statutID.equalsIgnoreCase(devisStateID)) {%> " alt=" "/> <%} else {%> " alt=" "/> <%} %> <% String oppPerID = null; try{ oppPerID = Opportunity.getOppPerID(); }catch(FieldNotInitializedException fe){ } if(oppPerID != null){ PersonBean perClient = new PersonBean(oppPerID, context); String phone = ""; try { phone = perClient.getPerPhone();; } catch (FieldNotInitializedException e) {} String mail = ""; try { mail = (String)perClient.getPerMail(); } catch (FieldNotInitializedException e) {} %> <% } %> " alt=" "/> <%} else if(statutID.equalsIgnoreCase(factureStateID)) { %> "/> " alt=" "/> " alt=" "/> <% // on récupère les champs concernant l'adresse du client (Tiers) if (oppEntID != null) { EnterpriseBean entClient = new EnterpriseBean(oppEntID, context); try { Enterprise.setEntID(entClient.getEntID()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntCorpName(entClient.getEntCorpName()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntCode(entClient.getEntCode()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntCtrID(entClient.getEntCtrID()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntCity(entClient.getEntCity()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntZip(entClient.getEntZip()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntPhone(entClient.getEntPhone()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntFax(entClient.getEntFax()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntWeb(entClient.getEntWeb()); } catch (FieldNotInitializedException e) { } try { Enterprise.setEntSiret(entClient.getEntSiret()); } catch (FieldNotInitializedException e) { } try { Enterprise.setCustomProperty("EntBP_", (String)entClient.getCustomProperty("EntBP_")); } catch (FieldNotInitializedException e) { Enterprise.setCustomProperty("EntBP_",""); } String voieNum = ""; try { voieNum = (String)entClient.getCustomProperty("EntVoieNum_"); } catch (FrontlineException e) { } String entNatureVoieID_ = null; try { entNatureVoieID_ = (String)entClient.getCustomProperty("EntNatureVoieID_"); entNatureVoieID_ = (String)dico.getRefDisp(FlLocale.getInstance(session), "Ev_", "Te1", entNatureVoieID_); } catch (FrontlineException e) { entNatureVoieID_ = ""; } String entLblVoie_ = ""; try { entLblVoie_ = (String)entClient.getCustomProperty("EntLblVoie_"); } catch (FrontlineException e) { entLblVoie_ = ""; } String entBP = ""; try { entBP = (String)entClient.getCustomProperty("EntBP_"); } catch (FrontlineException e) { entBP = ""; } String entIntraCom = ""; try { entIntraCom = (String)entClient.getCustomProperty("EntTVAIntracom_"); } catch (FrontlineException e) { entIntraCom = ""; } String cplAdr = ""; try { cplAdr = (String)entClient.getCustomProperty("EntGeoCplt_"); } catch (FrontlineException e) { } String remCour = ""; try { remCour = (String)entClient.getCustomProperty("EntPtRmCourrier_"); } catch (FrontlineException e) { } String lieuDit = ""; try { lieuDit = (String)entClient.getCustomProperty("EntLieuDit_"); } catch (FrontlineException e) { } String entBanque = ""; try { entBanque = (String)entClient.getCustomProperty("EntBanque_"); } catch (FrontlineException e) { } String entIBAN = ""; try { entIBAN = (String)entClient.getCustomProperty("EntIBAN_"); } catch (FrontlineException e) { } String entBIC = ""; try { entBIC = (String)entClient.getCustomProperty("EntBIC_"); } catch (FrontlineException e) { } %> <%} } %>
<%= enjPond %> €
<%= mail %>
<%= mail %>
<%=entIntraCom%>
"><%=Utils.formatToWeb(voieNum + ", " + entNatureVoieID_ + " " + entLblVoie_,false)%>
<%=cplAdr%>
<%=remCour%>
<%=lieuDit%>
<% try { Enterprise.getEntZip(); Enterprise.getEntCity(); %>
<% } catch(FieldNotInitializedException e) { try { Enterprise.getEntCity(); %>
<% } catch (FieldNotInitializedException ex) {}} %>
<%=entBanque%>
<%=entIBAN%>
<%=entBIC%>
<%-- --%> <% if(statutID.equalsIgnoreCase(devisStateID)) { %> <% } if(statutID.equalsIgnoreCase(commandeStateID)) { %> "/> <%} else if(statutID.equalsIgnoreCase(factureStateID)) { %> " alt=" "/> <% // on récupère les champs concernant l'adresse du Fournisseur (Tiers) if (oppBizProviderID != null) { EnterpriseBean entFournisseur = new EnterpriseBean(oppBizProviderID, context); try { Enterprise.setEntID(entFournisseur.getEntID()); } catch (FieldNotInitializedException e) { Enterprise.setEntID(""); } try { Enterprise.setEntCorpName(entFournisseur.getEntCorpName()); } catch (FieldNotInitializedException e) { Enterprise.setEntCorpName(""); } try { Enterprise.setEntCode(entFournisseur.getEntCode()); } catch (FieldNotInitializedException e) { Enterprise.setEntCode(""); } try { Enterprise.setEntCtrID(entFournisseur.getEntCtrID()); } catch (FieldNotInitializedException e) { Enterprise.setEntCtrID(""); } try { Enterprise.setEntCity(entFournisseur.getEntCity()); } catch (FieldNotInitializedException e) { Enterprise.setEntCity(""); } try { Enterprise.setEntPhone(entFournisseur.getEntPhone()); } catch (FieldNotInitializedException e) { Enterprise.setEntPhone(""); } try { Enterprise.setEntZip(entFournisseur.getEntZip()); } catch (FieldNotInitializedException e) { Enterprise.setEntZip(""); } try { Enterprise.setEntFax(entFournisseur.getEntFax()); } catch (FieldNotInitializedException e) { Enterprise.setEntFax(""); } try { Enterprise.setEntWeb(entFournisseur.getEntWeb()); } catch (FieldNotInitializedException e) { Enterprise.setEntWeb(""); } try { Enterprise.setEntSiret(entFournisseur.getEntSiret()); } catch (FieldNotInitializedException e) { Enterprise.setEntSiret(""); } try { Enterprise.setCustomProperty("EntBP_", (String)entFournisseur.getCustomProperty("EntBP_")); } catch (FieldNotInitializedException e) { Enterprise.setCustomProperty("EntBP_",""); } String voieNum = ""; try { voieNum = (String)entFournisseur.getCustomProperty("EntVoieNum_"); } catch (FrontlineException e) { } String entNatureVoieID_ = null; try { entNatureVoieID_ = (String)entFournisseur.getCustomProperty("EntNatureVoieID_"); entNatureVoieID_ = (String)dico.getRefDisp(FlLocale.getInstance(session), "Ev_", "Te1", entNatureVoieID_); } catch (FrontlineException e) { entNatureVoieID_ = ""; } String entLblVoie_ = ""; try { entLblVoie_ = (String)entFournisseur.getCustomProperty("EntLblVoie_"); } catch (FrontlineException e) { entLblVoie_ = ""; } String entBP = ""; try { entBP = (String)entFournisseur.getCustomProperty("EntBP_"); } catch (FrontlineException e) { entBP = ""; } String cplAdr = ""; try { cplAdr = (String)entFournisseur.getCustomProperty("EntGeoCplt_"); } catch (FrontlineException e) { } String remCour = ""; try { remCour = (String)entFournisseur.getCustomProperty("EntPtRmCourrier_"); } catch (FrontlineException e) { } String lieuDit = ""; try { lieuDit = (String)entFournisseur.getCustomProperty("EntLieuDit_"); } catch (FrontlineException e) { } String entBanque = ""; try { entBanque = (String)entFournisseur.getCustomProperty("EntBanque_"); } catch (FrontlineException e) { } String entIBAN = ""; try { entIBAN = (String)entFournisseur.getCustomProperty("EntIBAN_"); } catch (FrontlineException e) { } String entBIC = ""; try { entBIC = (String)entFournisseur.getCustomProperty("EntBIC_"); } catch (FrontlineException e) { } %> <%} } %>
"><%=Utils.formatToWeb(voieNum + ", " + entNatureVoieID_ + " " + entLblVoie_,false)%>
<%=cplAdr%>
<%=remCour%>
<%=lieuDit%>
<% try { Enterprise.getEntZip(); Enterprise.getEntCity(); %>
<% } catch(FieldNotInitializedException e) { try { Enterprise.getEntCity(); %>
<% } catch (FieldNotInitializedException ex) {}} %>
">
 
<% if(statutID.equalsIgnoreCase(factureStateID)) { %> ">
"> <% } %>
<% if (oppBillTiersID_ != null) { EnterpriseBean entBill = new EnterpriseBean(oppBillTiersID_, context); try { Enterprise.setEntID(entBill.getEntID()); } catch (FieldNotInitializedException e) { Enterprise.setEntID(""); } try { Enterprise.setEntCorpName(entBill.getEntCorpName()); } catch (FieldNotInitializedException e) { Enterprise.setEntCorpName(""); } try { Enterprise.setEntCode(entBill.getEntCode()); } catch (FieldNotInitializedException e) { Enterprise.setEntCode(""); } try { Enterprise.setEntCtrID(entBill.getEntCtrID()); } catch (FieldNotInitializedException e) { Enterprise.setEntCtrID(""); } try { Enterprise.setEntCity(entBill.getEntCity()); } catch (FieldNotInitializedException e) { Enterprise.setEntCity(""); } try { Enterprise.setEntPhone(entBill.getEntPhone()); } catch (FieldNotInitializedException e) { Enterprise.setEntPhone(""); } try { Enterprise.setEntZip(entBill.getEntZip()); } catch (FieldNotInitializedException e) { Enterprise.setEntZip(""); } try { Enterprise.setEntFax(entBill.getEntFax()); } catch (FieldNotInitializedException e) { Enterprise.setEntFax(""); } try { Enterprise.setEntWeb(entBill.getEntWeb()); } catch (FieldNotInitializedException e) { Enterprise.setEntWeb(""); } try { Enterprise.setEntSiret(entBill.getEntSiret()); } catch (FieldNotInitializedException e) { Enterprise.setEntSiret(""); } try { Enterprise.setCustomProperty("EntBP_", (String)entBill.getCustomProperty("EntBP_")); } catch (FieldNotInitializedException e) { Enterprise.setCustomProperty("EntBP_",""); } String voieNum = ""; try { voieNum = (String)entBill.getCustomProperty("EntVoieNum_"); } catch (FrontlineException e) { } String entNatureVoieID_ = null; try { entNatureVoieID_ = (String)entBill.getCustomProperty("EntNatureVoieID_"); entNatureVoieID_ = (String)dico.getRefDisp(FlLocale.getInstance(session), "Ev_", "Te1", entNatureVoieID_); } catch (FrontlineException e) { entNatureVoieID_ = ""; } String entLblVoie_ = ""; try { entLblVoie_ = (String)entBill.getCustomProperty("EntLblVoie_"); } catch (FrontlineException e) { entLblVoie_ = ""; } String entBP = ""; try { entBP = (String)entBill.getCustomProperty("EntBP_"); } catch (FrontlineException e) { entBP = ""; } String cplAdr = ""; try { cplAdr = (String)entBill.getCustomProperty("EntGeoCplt_"); } catch (FrontlineException e) { } String remCour = ""; try { remCour = (String)entBill.getCustomProperty("EntPtRmCourrier_"); } catch (FrontlineException e) { } String lieuDit = ""; try { lieuDit = (String)entBill.getCustomProperty("EntLieuDit_"); } catch (FrontlineException e) { } String entBanque = ""; try { entBanque = (String)entBill.getCustomProperty("EntBanque_"); } catch (FrontlineException e) { } String entIBAN = ""; try { entIBAN = (String)entBill.getCustomProperty("EntIBAN_"); } catch (FrontlineException e) { } String entBIC = ""; try { entBIC = (String)entBill.getCustomProperty("EntBIC_"); } catch (FrontlineException e) { } %> <%-- --%>
"><%=Utils.formatToWeb(voieNum + ", " + entNatureVoieID_ + " " + entLblVoie_,false)%>
<%=cplAdr%>
<%=remCour%>
<%=lieuDit%>
<% try { Enterprise.getEntZip(); Enterprise.getEntCity(); %>
<% } catch(FieldNotInitializedException e) { try { Enterprise.getEntCity(); %>
<% } catch (FieldNotInitializedException ex) {}} %>
<% } %> ">