Edit C:\Windows\install\galaxie_p01_01-10\sales\opportunity\edit.jsp
<% /****************************************************************************** * Copyright (c) 2000-2011 E-DEAL * * E-DEAL S.A. * 41, rue Périer * 92120 Montrouge * France * * T: +33 (0)1 73 03 29 80 * 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.EdealBigTabsNavigation"%> <%@ 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="com.edeal.frontline.SalesInvestBean" %> <%@ page import="java.util.Date" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.OpportunityBean" id="Opportunity" scope="request"/> <% 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(); String strActID = (String)session.getAttribute("actorID"); String id = null; boolean isCreate = false; try { id = Opportunity.getID(); } catch (FieldNotInitializedException fnie) { isCreate = true; } String salesModel = context.getContextParameter("SalesModel"); boolean isB2C = "B2C".equalsIgnoreCase(salesModel); String oppPerID = null; try { oppPerID = Opportunity.getOppPerID(); } catch (Exception e) { } String oppStoID = null; try { oppStoID = Opportunity.getOppStoID(); } catch (FieldNotInitializedException e) { oppStoID =""; } double oppNetApayer_ = 0; try{ oppNetApayer_ = (Double)Opportunity.getCustomProperty("OppNetApayer_"); }catch(FieldNotInitializedException fe){ } double oppTotalHT_ = 0; try{ oppTotalHT_ = (Double)Opportunity.getCustomProperty("OppTotalHT_"); }catch(FieldNotInitializedException fe){ } double oppTotalTVA_ = 0; try{ oppTotalTVA_ = (Double)Opportunity.getCustomProperty("OppTotalTVA_"); }catch(FieldNotInitializedException fe){ } double oppTotalTTC_ = 0; try{ oppTotalTTC_ = (Double)Opportunity.getCustomProperty("OppTotalTTC_"); }catch(FieldNotInitializedException fe){ } double oppTotalTPF_ = 0; try{ oppTotalTPF_ = (Double)Opportunity.getCustomProperty("OppTotalTPF_"); }catch(FieldNotInitializedException fe){ } double oppAcompte_ = 0; try{ oppAcompte_ = (Double)Opportunity.getCustomProperty("OppAcompte_"); }catch(FieldNotInitializedException fe){ } String oppAffiliationCtID_ = null; try { oppAffiliationCtID_ = (String)Opportunity.getCustomProperty("OppAffiliationCtID_"); } catch (FieldNotInitializedException e) { } String oppCmdTypoID = null; try { oppCmdTypoID = (String)Opportunity.getCustomProperty("OppCmdTypo_"); } catch (FieldNotInitializedException e) { } String devConc = null; try { devConc = (String)Opportunity.getCustomProperty("OppNumDev_"); } catch (FieldNotInitializedException e) { } String titreOnglet = ""; String titrePage = ""; // Détecter statut de l'opportunité String statutID = null;; try { statutID = Opportunity.getOppStoID(); } catch (FieldNotInitializedException e) { statutID = ""; } // Date de la commande Date dateCmd = null;; try { dateCmd = (Date) Opportunity.getCustomProperty("OppDatComm_"); } catch (FieldNotInitializedException e) { // Date du jour : Date dateDuJour = new Date(); Opportunity.setCustomProperty("OppDatComm_", dateDuJour); } // 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 = ""; } // si on a aun Avoir cad une nouvelle Opp dans l'état facture //si on est dans le cas de l'avoir les quantités doivent être toutes négatives String typeFact = flRequest.getParameter("typeFact"); Boolean QteProdNegFlag = null; if(typeFact != null && statutID.equalsIgnoreCase(factureStateID)) { QteProdNegFlag = true; } String oppFactAvoir_ = null; if (statutID.equalsIgnoreCase(factureStateID)) { oppFactAvoir_ = "false"; } try { oppFactAvoir_ = (String)Opportunity.getCustomProperty("OppFactAvoir_"); } catch (Exception e) { } // on envoie une famille de produits bien définie String prdFamilleProduit_ = null; try { prdFamilleProduit_ = (String)flRequest.getAttribute("initPrdFamilleProduit_"); } catch (Exception e) { } if (prdFamilleProduit_ == null && oppAffiliationCtID_ != null) { try { prdFamilleProduit_ = "STACI"; } catch (Exception e) { } } 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é"); } %> <script> function doOnLoad(){ doRefreshPros(); } function doRefreshPros() { doAjax('<fl:webapp/>/refresh_prodOpp_ajax.fl?listOnly=true&OppID=<%= id %>'); } function refreshPros() { setTimeout("doRefreshPros();", 20); } var strURL; function clearEntreprisePersonne() { document.forms[0].elements["OppPerID"].value = ''; document.forms[0].elements["lblOppPerID"].value = ''; } function doSelectEntry(){ var fenetreChoix; fenetreChoix = window.open('<fl:webapp/>/select_entry.fl?typ=Person&EntID='+encodeURIComponent(document.forms[0].OppEntID.value)+'&PerID='+encodeURIComponent(document.forms[0].OppPerID.value), 'ChoixEntreprisePersonne' , 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=770,height=360'); } function doOppEntIDChange(){ clearEntreprisePersonne(); } function verifPresenceArticles() { var f = document.forms[0]; presence = false; if(f.presenceArticles.value == 'true') { presence = true; } if(presence) { submit(); } else { alert("Vous devez choisir au moins un produit."); } } </script> <script type="text/javascript" language="javascript" src="<fl:link url="/sales/opportunity/opportunity_edit_js.jsp"/>?salesModel=<%= salesModel %>"></script> <fl:form action="/save_opportunity.fl" bean="Opportunity"> <fl:bigTabs objectTitle="<%=titrePage%>" ou="<%= \"/edit_opportunity.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <input type="hidden" name="presenceArticles" value="false"> <input type="hidden" name="OppNetApayer_" value="<%=oppNetApayer_%>"> <input type="hidden" name="OppTotalHT_" value="<%=oppTotalHT_%>"> <input type="hidden" name="OppTotalTVA_" value="<%=oppTotalTVA_%>"> <input type="hidden" name="OppTotalTTC_" value="<%=oppTotalTTC_%>"> <input type="hidden" name="OppTotalTPF_" value="<%=oppTotalTPF_%>"> <input type="hidden" name="strURL" value=""> <input type="hidden" name="OppStoID" value="<%=oppStoID%>"> <% if(prdFamilleProduit_ != null) {%> <input type="hidden" name="prdfamilleproduit_id" value="<%=prdFamilleProduit_%>"> <%} %> <% if(oppFactAvoir_ != null) {%> <input type="hidden" name="OppFactAvoir_" value="<%=oppFactAvoir_%>"> <%} %> <% if(oppAffiliationCtID_ != null) {%> <input type="hidden" name="OppAffiliationCtID_" value="<%=oppAffiliationCtID_%>"> <%} %> <% if(oppCmdTypoID != null) {%> <input type="hidden" name="OppCmdTypo_" value="<%=oppCmdTypoID%>"> <%} %> <table class="container" cellpadding="0"> <tbody> <tr> <td colspan="5" class="width: 100%; margin: 0px; padding: 0px;"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td><fl:label field="OppTitle" labelClassName="labelTitreFiche" code="F2016"/></td> <td class="fieldTitreFiche"><fl:input property="OppTitle"/></td> <% if (id != null && devConc != null) { %> <td class="fieldTitreFiche"> <div> <span style="font-size: larger;">Devis concerné : <fl:getProperty name="Opportunity" property="OppNumDev_" alt=" "/></span> </div> </td> <% } %> </tr> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <% if(statutID.equalsIgnoreCase(devisStateID) ) { %> <%-- si c'est encore un devis --%> <fl:fieldEdit property="OppDatDev_" labelCode="FF0ED" format="date" mandatoryMsgCode="MF063"/> <%-- <fl:fieldEdit property="OppDate" labelCode="L3053" format="date"/> --%> <fl:fieldEdit property="OppCnlDev_" alt="" mandatoryMsgCode="MF092"/> <%} else if (statutID.equalsIgnoreCase(commandeStateID) ) {%> <fl:fieldEdit property="OppDatComm_" labelCode="FF0EE" format="date" mandatoryMsgCode="MF0AE"/> <fl:fieldEdit property="OppCnlCom_" mandatoryMsgCode="MF0AF"/> <%} else if (statutID.equalsIgnoreCase(factureStateID) ) { %> <fl:fieldEdit property="OppDatExp_" labelCode="FF144" format="date" /> <fl:fieldEdit property="OppDatFact_" labelCode="F6112" format="date" mandatoryMsgCode="MF0B0"/> <fl:fieldEdit property="OppRefFact_" labelCode="FF0FC" format="date" mandatoryMsgCode="MF0B1"/> <% }%> <tr class="ligne_separation"><td></td></tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="FF0A9" alt="Client"/> </td> <tr class="ligne_separation"><td></td></tr> <% if (statutID.equalsIgnoreCase(factureStateID) ) {%> <fl:fieldEdit property="OppCompteClient_" /> <%} %> <!-- <fl:fieldEdit property="OppEntID" mandatoryMsgCode="MF08F" ondelete="clearEntreprisePersonne()" query="EntStatus:RefVal = 'ON'"/> --> <!-- <fl:fieldEdit property="OppPerID" mandatoryMsgCode="LF1B7" query="PerEntID:EntStatus:RefVal = 'ON'" /> --> <fl:fieldEdit property="OppPerID" mandatoryMsgCode="LF1B7" /> <fl:fieldEdit property="OppEntID" ondelete="clearEntreprisePersonne()" query="EntStatus:RefVal = 'ON'"/> <tr class="ligne_separation"><td></td></tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="L63E9" alt="Fournisseur"/> </td> <tr class="ligne_separation"><td></td></tr> <!-- <fl:fieldEdit property="oppBizProviderID" mandatoryMsgCode="MF093" labelCode="F80ED" query="EntStatus:RefVal = 'ON'"/> --> <% if(isCreate){ %> <fl:fieldEdit label="Fournisseur" property="OppAccountID_" mandatoryMsgCode="MF091"/> <% }else{ %> <fl:fieldEdit label="Fournisseur" property="OppAccountID_" mandatoryMsgCode="MF091" readOnly="true"/> <% } %> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0"> <% if(statutID.equalsIgnoreCase(devisStateID) ) { %> <fl:fieldEdit property="OppDatExp_" format="date"/> <% } else if(statutID.equalsIgnoreCase(factureStateID) ) { %> <fl:fieldEdit property="OppAcompte_" /> <fl:fieldEdit property="OppActID" mandatoryMsgCode="M3018" labelCode="FF107"/> <%} else if (statutID.equalsIgnoreCase(commandeStateID) || statutID.equalsIgnoreCase(devisStateID)) {%> <fl:fieldEdit property="OppTypCom_"/> <fl:fieldEdit property="OppModReg_" type="list" alt="" /> <tr class="ligne_separation"><td></td></tr> <fl:fieldEdit property="OppStatComm_"/> <fl:fieldEdit property="OppDatExp_" labelCode="FF144" format="date"/> <tr class="ligne_separation"><td></td></tr> <fl:fieldEdit property="OppActID" mandatoryMsgCode="MF097" labelCode="FF107"/> <%} %> </table> </td> </tr> </tbody> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:getMessage code="L64B4" alt="Commentaires"/></td> </tr> <tr> <td class="dataValue noPaddingLeft"><fl:input property="OppNotes_" nodiv="false"/></td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> </table> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="OpportunityTabs"> <fl:sTab id="PRODUCT" title="<%=titreOnglet%>" onselect="refreshPros();"> <div id="ProdOppTable" class="edealGrid"> <table class="container" cellpadding="0" style="width: 100%;"> <tr> <td> </td> </tr> </table> </div> </fl:sTab> <% if(statutID.equalsIgnoreCase(factureStateID)) { %> <fl:sTab id="COMPTA" title="<%= Utils.getMessage(session, \"LF152\", \"Comptabilité\") %>"> <table class="container" style="" cellpadding="0"> <tr class="fieldline"> <td class="column2"> <fl:fieldEdit property="OppCodeCompta_" alt=""/> <fl:fieldEdit property="OppCdCpAnalytic_" alt=""/> </td> </tr> </table> </fl:sTab> <fl:sTab id="INVOICE" title="<%= Utils.getMessage(session, \"LF075\", \"Adresse de facturation\") %>"> <table class="container" style="" cellpadding="0"> <tr class="fieldline"> <td class="column2"> <fl:fieldEdit property="OppBillTiersID_"/> </td> </tr> </table> </fl:sTab> <% } %> <fl:sTab id="ATTACHMENT" title="<%= Utils.getMessage(session, \"L201C\", false, true, \"Documents joints\") %>"> <fl:attach name="Opportunity" colID="OppAttID" /> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de