Edit C:\galaxie\Back\galaxie\sales\productOpportunity\edit.jsp
<%/****************************************************************************** * Copyright (c) 2000-2006 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="com.edeal.frontline.grid.GridData" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.controller.actions.SelectAction" %> <%@ page import="com.edeal.frontline.helper.custom.OpportunityHelper" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.ProductGroupEntryBean" id="ProductGroupEntry" scope="request"/> <jsp:useBean class="com.edeal.frontline.ProductBean" id="Product" scope="request"/> <html> <head> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/master_css.jsp"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/utils.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/checkFields.jsp"/>"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/presentField.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ac/fobAC_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript" src="<fl:webapp/>/js/smalltabs.jsp"></script> <% 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 OppID = flRequest.getParameter("OppID"); if (OppID == null) { OppID = ""; } OpportunityBean oppLoaded = new OpportunityBean (OppID , context); // si une famille de produit doit être initialisée String prdFamilleProduit_ = flRequest.getParameter("PrdFamilleProduit_"); //si on est dans le cas de l'avoir les quantités doivent être toutes négatives String negSelProd = flRequest.getParameter("negSelProd"); if (negSelProd == null) { negSelProd="false"; } String id = ""; String errorMsg = Utils.getMessage(session, "M302F", true, "Format de nombre incorrect. Veuillez corriger."); String floatChange = "ctrlNumField(this, 'float', '" + errorMsg + "'); calculPrix(this);"; String intChange = "ctrlNumField(this, 'integer', '" + errorMsg + "'); checkQuantity(this); calculPrix(this);"; Vector tpfValDisp = new Vector(); tpfValDisp = dico.getRefList("Pp_", "Nu1"); Vector tpfValTyp = new Vector(); tpfValTyp = dico.getRefList("Pp_", "Te2"); Vector tvaValDisp = new Vector(); tvaValDisp = dico.getRefList("Pv_", "Nu1"); Vector remValDisp = new Vector(); remValDisp = dico.getRefList("Od_", "Nu1"); // Rgs pour la TVA intracom... String valRestr = ""; // on récupère le client tiers, si on ne le trouve pas on va chercher le tiers du client String oppEntID = null; String oppPerID = null; String ctrID = null; String intraCom = null; // par défaut initialisé à 0 pour FRANCE tva toujours disponible Double rgcalcTVA = (double) 0; String rgcalcTVAstr = "0"; // on recupère les options String cValeursRestrictionTVA = ""; String cValeursRestrictionSansTVA = ""; try { cValeursRestrictionTVA = context.getContextParameter("CValeursRestrictionTVA"); cValeursRestrictionSansTVA = context.getContextParameter("CValeursRestrictionSansTVA"); //cValeursRestrictionTVA = OpportunityHelper.getRestrictionsWithoutPrdTVADefault(context, cValeursRestrictionTVA); //29547: Application du taux de TVA pour un article (FEV 217) //cValeursRestrictionSansTVA = OpportunityHelper.getRestrictionsWithoutPrdTVADefault(context, cValeursRestrictionSansTVA); //29547: Application du taux de TVA pour un article (FEV 217) try { oppEntID = oppLoaded.getOppEntID(); EnterpriseBean entr = new EnterpriseBean( oppEntID , context); ctrID = (String) entr.getEntCtrID(); try { intraCom = (String) entr.getCustomProperty("EntTVAIntracom_"); } catch (FieldNotInitializedException e) { } } catch (Exception e) { } if(oppEntID == null) { try { oppPerID = oppLoaded.getOppPerID(); PersonBean pers = new PersonBean(oppPerID , context); ctrID = (String)pers.getPerCtrID(); } catch (Exception e) { } } // le pays est recupere if(ctrID != null) { try{ rgcalcTVA = (Double)dico.getRefDisp("Ctr", "Nu3", ctrID); } catch (FrontlineException e) { } rgcalcTVAstr = rgcalcTVA.toString(); rgcalcTVAstr = rgcalcTVAstr.substring(0,1); int tvaCase = Integer.parseInt(rgcalcTVAstr); if( tvaCase == 2 ) { // voir les cas de intraCom si renseignee ou pas if(intraCom != null) { // on n'applique jamais la TVA valRestr = cValeursRestrictionSansTVA; } else { valRestr = cValeursRestrictionTVA; } } else if ( tvaCase == 1 ) { // on applique pas la TVA valRestr = cValeursRestrictionSansTVA; } else if ( tvaCase == 0 ) { // la france on restreint la TVA 0% ET sans TVA valRestr = cValeursRestrictionTVA ; } } }catch (Exception e) { } //41208: Génération de factures monjtant HT faux (ACM) String lng = (String)ActorBean.lookup(context, "ActLngPrinc:RefVal", (String) session.getAttribute("actorID")); %> <script type="text/javascript" language="javascript"> // Used to handle the action taken when the user hits the enter key var currentAction = 0; var doSubmitProd = false; // Used to process price changes function doOnLoad() { document.onkeyup = checkEventKey; show(); hide(); refreshSelectedList(); var forms = document.getElementsByTagName('form'); for (var i=0;i < forms.length;i++) { var inputs = forms[i].getElementsByTagName('input'); for (var j=0;j < inputs.length;j++) addInputSubmitEvent(forms[i], inputs[j]); } } function addInputSubmitEvent(form, input) { input.onkeydown = function(e) { e = e || window.event; if (e.keyCode == 13) { form.submit(); return false; } return true; }; } function checkEventKey(event) { var keyPress = 0; try { keyPress = event.which; } catch (error) { } if (keyPress == 0) { try { keyPress = window.event.keyCode; } catch (error) { } } if (acCurHighlightedDiv == null && keyPress == 13) { switch (currentAction) { case 0: doSearch(); break; case 1: saveProdOpp(); break; case 2: currentAction=0; break; default: break; } } return false; } function doSearch() { var parameters=new Array(); var f = window.document.forms[0]; var str = '&OppID=<%= OppID %>'; if (f.PrdName.value != '' && f.PrdName.value != '<fl:getMessage code="L6122" alt="<Désignation>" js="true"/>') { //str += "&PrdName=" + f.PrdName.value; parameters["PrdName"]=f.PrdName.value; } /* if (f.PrdFamilyID.value != '' && f.lblPrdFamilyID.vale != '<fl:getMessage code="L635D" alt="<Famille>" js="true"/>') { //str += "&PrdFamilyID=" + f.PrdFamilyID.value; parameters["PrdFamilyID"]=f.PrdFamilyID.value; } */ if (f.PrdCode.value != '' && f.PrdCode.value != '<fl:getMessage code="M602D" alt="<Code>" js="true"/>') { //str += "&PrdCode=" + f.PrdCode.value; parameters["PrdCode"]=f.PrdCode.value; } parameters["PrdFamilleProduit_"]=f.PrdFamilleProduit_.value; parameters['ListProduct_$$nb']=0; parameters['ListProduct_$$idx']=0; _grid__ListProduct_js_.callAjaxForHtml(_grid__ListProduct_js_.getAjaxUrl(),parameters,true,false,null,false,false); } function hide() { divDisplay = document.getElementById('createProd'); divDisplay.style.visibility = 'hidden'; } function show() { document.getElementById('createProd').style.visibility = 'visible'; } function selectProd(PrdID) { doSubmitProd = true; currentAction = 1; selectProdOpp(PrdID, ''); } function selectProdOpp(PrdID, ProID) { var strUrl = '<fl:link url="<%= \"/ajax_opp_selectprod.fl?\" %>"/>'; if (ProID != '') { strUrl += '&ProID=' + ProID; } if (PrdID != '') { strUrl += '&PrdID=' + PrdID; } strUrl += '&OppID=<%= OppID %>'; doAjax(strUrl); show(); } function parseFloatFromSysNum (value) { if (value!=null) { value+=""; value = value.replace(" ", ""); value = value.replace(',',/\./g); } return parseFloat(value); } function checkQuantity(elem) { var msgerr = ""; var max = document.getElementById("maxproductquantity").value; msgerr = '<fl:getMessage code="MF0E9" alt="Veuillez préciser une autre quantité avec un maximum de : " js="true"/>' ; msgerr += max; //alert(max); if(parseFloat(toSysNum(elem.value)) > 0 && parseFloat(toSysNum(elem.value)) > max){ alert(msgerr); elem.value = ""; return; } if(parseFloat(toSysNum(elem.value)) < 0 && -(parseFloat(toSysNum(elem.value))) > max){ alert(msgerr); elem.value = ""; return; } } function calculPrix(leChamp) { myForm = leChamp.form; //if field is not a number, blank it if (isNaN(parseFloat(toSysNum(leChamp.value)))){ leChamp.value = ""; } //grab current values var quantity = toSysNum(myForm.ProQuantity.value); var discountMny = toSysNum(myForm.ProRemise_.value); var tvaSelected = toSysNum(myForm.PrdTVADefaut_.value); var tpfSelected = toSysNum(myForm.PrdTaxeParafiscale_.value); var price = toSysNum(myForm.ProPrice.value); var unitPrice = toSysNum(myForm.ProUnitPrice.value); //if there is no unit price or no quantity, blank total price if (isNaN(parseFloat(unitPrice)) || quantity == "") { myForm.ProPrice.value = ""; return; } //if the quantity just changed or (the total price just changed and is blank) if ((leChamp.name == "ProUnitPrice" || leChamp.name == "ProQuantity" || leChamp.name == "ProRemise_" || leChamp.name == "PrdTVADefaut_" || leChamp.name == "PrdTaxeParafiscale_") || (leChamp.name == "ProPrice" && myForm.ProPrice.value == "")){ //if there is no discount if ((discountMny == "")) { var newPrice = unitPrice * parseFloat(quantity); appendPriceHT(newPrice); appendPriceUnit(unitPrice); calculTVATPF(newPrice,tvaSelected,tpfSelected,parseFloat(quantity)); //if the money discount is specified } else if (discountMny != "") { calculTVATPF(calculRemise(discountMny,price,unitPrice,quantity), tvaSelected, tpfSelected,parseFloat(quantity)); } } ctrlNumField(myForm.ProQuantity, "integer"); ctrlNumField(myForm.ProPrice, "float"); } function calculTVATPF(newPrice, tvaSel, tpfSel, qte) { var tpfVal = 0; var tpfTyp = "PC"; var tvaVal = 0; <% for (int i = 0; i < tpfValDisp.size(); i++) { Vector objectNum = (Vector)tpfValDisp.elementAt(i); Vector objectTyp = (Vector)tpfValTyp.elementAt(i); String idTpf = (String) objectNum.elementAt(0); String typTpf = (String) objectTyp.elementAt(1); double valTpf = (Double) objectNum.elementAt(1); %> if(tpfSel == "<%=idTpf%>") { tpfVal = <%=valTpf%>; // valeur TPF tpfTyp = "<%=typTpf%>"; } <% } %> <% for (int i = 0; i < tvaValDisp.size(); i++) { Vector objectNum = (Vector)tvaValDisp.elementAt(i); String idTva = (String) objectNum.elementAt(0); double valTva = (Double) objectNum.elementAt(1); %> if(tvaSel == "<%=idTva%>") { tvaVal = <%=valTva%>; // valeur TVA } <% } %> var priceNetTVA = newPrice * (1 + (parseFloatFromSysNum(tvaVal)/100)); if (tpfTyp == "PC") { var priceNetTPF = newPrice * (1 + (parseFloatFromSysNum(tpfVal)/100)); var priceNetTVATPF = newPrice * (1 + (parseFloatFromSysNum(tvaVal)/100) + (parseFloatFromSysNum(tpfVal)/100)); } else if (tpfTyp == "AM") { var priceNetTPF = newPrice + (parseFloatFromSysNum(tpfVal) * qte); var priceNetTVATPF = newPrice * (1 + (parseFloatFromSysNum(tvaVal)/100)) + (parseFloatFromSysNum(tpfVal) * qte); } var montantTpf = parseFloatFromSysNum(priceNetTPF) - parseFloatFromSysNum(newPrice); var montantTva = parseFloatFromSysNum(priceNetTVA) - parseFloatFromSysNum(newPrice); appendPrice(priceNetTVATPF); appendMontantTPF(montantTpf); appendMontantTVA(montantTva); } function calculRemise(discountMny,price,unitPrice,quantity) { var discountP = 0 ; <% for (int i = 0; i < remValDisp.size(); i++) { Vector objectNum = (Vector)remValDisp.elementAt(i); String idRem = (String) objectNum.elementAt(0); double valRem = (Double) objectNum.elementAt(1); %> if(discountMny == "<%=idRem%>") { discountP = <%=valRem%>; // valeur Remise } <% } %> var newPrice = (parseFloatFromSysNum(unitPrice) * parseFloat(quantity)) * (1 - (parseFloatFromSysNum(discountP)/100)); appendPriceHT(newPrice); var newPriceUnit = (parseFloatFromSysNum(unitPrice)) * (1 - (parseFloatFromSysNum(discountP)/100)); appendPriceUnit(newPriceUnit); return newPrice; } function appendPriceUnit(newPrice) { var newRoundPrice = roundNumber(newPrice, 2); if('en_US'!='<%= lng %>'){ window.document.getElementById('edit_ProUnitRemise').innerHTML = newRoundPrice.toString().replace(/\./g,','); }else{ window.document.getElementById('edit_ProUnitRemise').innerHTML = newRoundPrice.toString(); } } function appendPriceHT(newPrice) { var newRoundPrice = roundNumber(newPrice, 2); if('en_US'!='<%= lng %>'){ window.document.getElementById('edit_ProMontantHT').innerHTML = newRoundPrice.toString().replace(/\./g,','); }else{ window.document.getElementById('edit_ProMontantHT').innerHTML = newRoundPrice.toString(); } } function appendPrice(newPrice) { var newRoundPrice = roundNumber(newPrice, 2); myForm.ProPrice.value = newRoundPrice.toString(); } function appendMontantTVA(montantTva) { var newRoundPrice = roundNumber(montantTva, 2); if('en_US'!='<%= lng %>'){ window.document.getElementById('edit_ProMontantTVA').innerHTML = newRoundPrice.toString().replace(/\./g,','); }else{ window.document.getElementById('edit_ProMontantTVA').innerHTML = newRoundPrice.toString(); } } function appendMontantTPF(montantTpf) { var newRoundPrice = roundNumber(montantTpf, 2); window.document.getElementById('edit_ProMontantTPF').innerHTML = newRoundPrice.toString(); } function appendDiscountPercentage(newDiscountPercentage) { var newRoundPrice = roundNumber(newDiscountPercentage, 2); myForm.ProDiscountP.value = newRoundPrice.toString(); } function appendDiscountMoney(newDiscountPrice) { var newRoundPrice = roundNumber(newDiscountPrice, 2); myForm.ProDiscountMny.value = newRoundPrice.toString(); } //http://u-project2.umanis.com/view.php?id=45506 function saveProdOpp() { if (!doSubmitProd) { return; } var f = window.document.forms[0]; if (f.ProPrdID.value == '' || f.ProDesignation.value == '') { alert('<fl:getMessage code="MF19F" alt="Veuillez patienter s\\\'il vous plait, la ligne de produit est..." js="true"/>'); f.ProQuantity.focus(); return ; } if (f.ProUnitPrice.value == '') { alert('<fl:getMessage code="M60CD" alt="Vous devez préciser le prix unitaire." js="true"/>'); f.ProUnitPrice.focus(); return ; } var negselFlag = f.negSelProd.value; if (f.ProQuantity.value == '') { alert('<fl:getMessage code="M301E" alt="Vous devez préciser la quantité." js="true"/>'); f.ProQuantity.focus(); return ; } if (f.ProRemise_.value == '' || window.document.getElementById('edit_ProMontantTVA').innerHTML == '' || window.document.getElementById('edit_ProMontantTPF').innerHTML == '' || window.document.getElementById('edit_ProMontantHT').innerHTML == '' || window.document.getElementById('edit_ProUnitRemise').innerHTML == '' || f.ProPrice.value == '' || f.PrdTVADefaut_.value == '' || f.PrdTaxeParafiscale_.value == '') { alert('<fl:getMessage code="MF1A0" alt="Une erreur est survenue. L\'une des données de la ligne de produit est manquante, veuillez recommencer en séléctionnant le produit." js="true"/>'); f.ProQuantity.focus(); return ; } /* laisser l'utilisateur mettre des quantités négatives 21/04/2015 else if (negselFlag=='false' && f.ProQuantity.value <= '0') { alert('<fl:getMessage code="M60B5" alt="Vous devez préciser une quantité supérieure à 0." js="true"/>'); f.ProQuantity.focus(); return; } else if (negselFlag=='true' && f.ProQuantity.value >= '0') { alert('<fl:getMessage code="MF094" alt="Vous devez préciser une quantité inférieure à 0." js="true"/>'); f.ProQuantity.focus(); return; } */ else if (window.document.getElementById('edit_PrdStockActuel_').innerHTML != 'Non geré') { var qteChoisie = toSysNum(f.ProQuantity.value); var qteStock = 0; qteStock = toSysNum(window.document.getElementById('edit_PrdStockActuel_').innerHTML); if(parseFloat(qteChoisie) > parseFloat(qteStock)) { alert('<fl:getMessage code="LF0AD" alt="La quantité choisie ne doit pas dépasser le stock actuel du produit." js="true"/>'); f.ProQuantity.focus(); return; } } if(f.ProRemise_.value == '') { alert('<fl:getMessage code="MF090" alt="Vous devez préciser la remise sur P.U." js="true"/>'); f.ProRemise_.focus(); return; } var args = '&type=ProductOpportunity&$$presentFields='; if (f.ProID.value != '') { args += '&id=' + f.ProID.value; } args += '&ProOppID=<%= OppID %>'; args += '&ProPrdID=' + f.ProPrdID.value; args += '&ProQuantity=' + encodeURIComponent(f.ProQuantity.value); args += '&ProDesignation=' + encodeURIComponent(f.ProDesignation.value); args += '&ProRemise_=' + encodeURIComponent(f.ProRemise_.value); if('en_US'!='<%= lng %>'){ args += '&ProUnitPrice=' + encodeURIComponent(f.ProUnitPrice.value.replace(/\./g,',')); args += '&ProMontantTva_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantTVA').innerHTML.replace(/\./g,',')); args += '&ProMontantTpf_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantTPF').innerHTML.replace(/\./g,',')); args += '&ProMontantHTrem_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantHT').innerHTML.replace(/\./g,',')); args += '&ProUnitHTrem_=' + encodeURIComponent(window.document.getElementById('edit_ProUnitRemise').innerHTML.replace(/\./g,',')); args += '&ProPrice=' + encodeURIComponent(f.ProPrice.value.replace(/\./g,',')); }else{ args += '&ProUnitPrice=' + encodeURIComponent(f.ProUnitPrice.value.replace(',','')); args += '&ProMontantTva_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantTVA').innerHTML.replace(',','')); args += '&ProMontantTpf_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantTPF').innerHTML.replace(',','')); args += '&ProMontantHTrem_=' + encodeURIComponent(window.document.getElementById('edit_ProMontantHT').innerHTML.replace(',','')); args += '&ProUnitHTrem_=' + encodeURIComponent(window.document.getElementById('edit_ProUnitRemise').innerHTML.replace(',','')); args += '&ProPrice=' + encodeURIComponent(f.ProPrice.value.replace(',','')); } //args += '&ProPrice=' + encodeURIComponent(f.ProPrice.value); args += '&ProPrdTva_=' + encodeURIComponent(f.PrdTVADefaut_.value); args += '&ProPrdTaxeParafiscale_=' + encodeURIComponent(f.PrdTaxeParafiscale_.value); //alert(args); var url = '<fl:link url="/save_object_ajax.fl?"/>' + args; currentAction = 2; // To prevent search list from automatically triggering document.getElementById('searchHref').focus(); // To prevent IE from beeping when next enter is pressed doAjax(url, waitNrefreshSL); hide(); doSubmitProd = false; document.getElementById("maxproductquantity").value = ""; document.getElementById("ProQuantity").value = ""; } function doRefreshSelectedList() { if (eDealXmlhttp.readyState == 4) { myGrid_ListSelectedProduct.refresh(); } } function roundNumber(rnum, rlength) { var multiplier = Math.pow(10, rlength); return Math.round(rnum * multiplier) / multiplier; } function refreshSelectedList() { doAjax('<fl:webapp/>/refresh_prodOpp_ajax.fl?listOnly=false&OppID=<%= OppID %>'); } function doSubmit() { return true; } function doTransfert() { f = window.top.opener.document.forms[0]; mf = document.forms[0]; total = mf.total.value; totalHT = mf.totalHT.value; totalTVA = mf.totalTVA.value; totalTPF = mf.totalTPF.value; f.OppTotalHT_.value = totalHT; f.OppTotalTVA_.value = totalTVA; f.OppTotalTTC_.value = total; f.OppTotalTPF_.value = totalTPF; window.top.opener.doRefreshPros(); window.top.close(); } function doEdit(ProID) { doSubmitProd = true; currentAction = 1; selectProdOpp('',ProID); } function doDelete(ProID) { var f = window.document.forms[0]; if (confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>')) { doAjax('<fl:link url="/delete_object_ajax.fl?"/>&type=ProductOpportunity&id=' + ProID, waitNrefreshSL); hide(); } } function waitNrefreshSL(arrIndex) { currentState = 0; if (eDealXmlhttpArr[arrIndex].readyState == 4) { refreshSelectedList(); } } </script> </head> <body style="height: auto;"> <div id="object_css" style="top: 0px;"> <fl:form action="javascript:saveProdOpp()" bean="ProductGroupEntry"> <fl:bigTabs objectTitle="<%=Utils.getMessage(session, \"L653F\", \"Devis\")%>" ou="<%= \"/edit_productgroupentry.fl\" + (id != null ? \"?id=\" + id : \"\")%>"> <% if(negSelProd != null) {%> <input type="hidden" name="negSelProd" value="<%=negSelProd%>"> <%} %> <input type="hidden" id="maxproductquantity" name="maxproductquantity" value="" /> <input type="hidden" name="$$returnedHtmlHead" value=""> <input type="hidden" name="$$returnedHtmlBody" value="..."> <input type="hidden" name="ProOppID" value=""> <input type="hidden" name="ProPrdID" value=""> <input type="hidden" name="totalHT" value=""> <input type="hidden" name="totalTVA" value=""> <input type="hidden" name="totalTPF" value=""> <input type="hidden" name="total" value=""> <input type="hidden" name="ProDesignation" value=""> <input type="hidden" name="valRestr" id="valRestr" value="<%=valRestr%>"> <!-- <input name="ProUnitPrice" type="hidden" value="" > --> <table class="container" cellpadding="0" border="0"> <tr> <td style="width:15%"> <!-- Begin search area --> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td colspan="2" class="titreInterneSmalltabs"><fl:getMessage code="LF184" alt="Articles"/></td> </tr> <tr valign="top" class="ligne_separation"><td></td></tr> <!-- <tr valign="top"> <td id="PrdFamilyID_label" class="dataValue" colspan="2"> <div class="input fieldTable"> <table class="fieldTable" cellpadding="0" cellspacing="0"> <tbody> <tr valign="top"> <td class="principalText bigFieldPart"> <div class="fobLeftDiv"> <input id="PrdFamilyID" name="PrdFamilyID" value="" type="hidden"/> <input id="lblPrdFamilyID" name="lblPrdFamilyID" value="<fl:getMessage code="L635D" alt="<Famille>"/>" autocomplete="off" onfocus="displayOnFocus(this);acResizeDisplayDiv(this);" class="input fob" type="text" style="width: 100%;"/> </div> </td> <td class="smallFieldPart"> <a href="javascript:var win = window.open('<fl:webapp/>/select.fl?type=ProductFamily&field=PrdFamilyID&formIndex=0', 'SelectProductFamily', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400')"><img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="Sélectionner" title="Sélectionner"></a> <a href="javascript:var f = window.document.forms[0]; f.PrdFamilyID.value = ''; f.lblPrdFamilyID.value = '<fl:getMessage code="L635D" alt="<Famille>" js="true"/>'; acLastCompleteValues['lblPrdFamilyID'] = '';acLastCompleteValues['PrdFamilyID'] = ''; void('')"><img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="Vider le champ" title="Vider le champ"></a><script language="javascript">runOnTime("installFobAC(document.forms[0].lblPrdFamilyID);", 200);</script> </td> </tr> </tbody> </table> </div> </td> </tr> --> <%if(prdFamilleProduit_ != null) { %> <tr class="fieldline"> <td id="PrdFamilleProduit__label" class="dataLabel"> <div> <label title="<fl:getMessage code="L62E4" alt="Famille de produit"/>" for="PrdFamilleProduit_"><fl:getMessage code="L62E4" alt="Famille de produit"/></label> </div> </td> <td id="PrdFamilleProduit__value" class="dataValue"> <div class="input select"> <select id="PrdFamilleProduit_" class="input select" name="PrdFamilleProduit_"> <% Vector vectVal = new Vector(); Vector vectValDisp = new Vector(); vectVal = dico.getRefList("Pf_", "Te2"); vectValDisp = dico.getRefList("Pf_", "Te1"); for (int i = 0; i < vectVal.size(); i++) { Vector objectTe2 = (Vector)vectVal.elementAt(i); Vector objectTe1 = (Vector)vectValDisp.elementAt(i); String idFamille = (String) objectTe2.elementAt(0); String catFamille = (String) objectTe2.elementAt(1); if(catFamille.equalsIgnoreCase(prdFamilleProduit_) ) {%> <option value="<%=idFamille%>"><%=objectTe1.elementAt(1)%></option> <%}else{ if(OppID != null && !OppID.isEmpty() && OppID.length()==16){ String idDevis = ""; String idDevisAss = ""; try{ idDevis = (String) OpportunityBean.lookup(context, "OppEntID:EntCotDevID_", OppID); }catch(Exception e){ logger.warn(e.getMessage()); } try{ idDevisAss = (String) OpportunityBean.lookup(context, "OppEntID:EntCotAssoDevID_", OppID); }catch(Exception e){ logger.warn(e.getMessage()); } if((idDevis!=null && !idDevis.isEmpty() && idDevis.length()==16 && idDevis.contains(OppID)) || (idDevisAss!=null && !idDevisAss.isEmpty() && idDevisAss.length()==16 && idDevisAss.contains(OppID)) || (negSelProd.equals("true"))){ %> <option value="<%=idFamille%>"><%=objectTe1.elementAt(1)%></option> <% } } } }%> </select> </div> </td> </tr> <%} else { String prdFamilleProduit_2 ="STACI"; %> <tr class="fieldline"> <td id="PrdFamilleProduit__label" class="dataLabel"> <div> <label title="<fl:getMessage code="L62E4" alt="Famille de produit"/>" for="PrdFamilleProduit_"><fl:getMessage code="L62E4" alt="Famille de produit"/></label> </div> </td> <td id="PrdFamilleProduit__value" class="dataValue"> <div class="input select"> <select id="PrdFamilleProduit_" class="input select" name="PrdFamilleProduit_"> <% Vector vectVal = new Vector(); Vector vectValDisp = new Vector(); vectVal = dico.getRefList("Pf_", "Te2"); vectValDisp = dico.getRefList("Pf_", "Te1"); for (int i = 0; i < vectVal.size(); i++) { Vector objectTe2 = (Vector)vectVal.elementAt(i); Vector objectTe1 = (Vector)vectValDisp.elementAt(i); String idFamille = (String) objectTe2.elementAt(0); String catFamille = (String) objectTe2.elementAt(1); if(!catFamille.equalsIgnoreCase(prdFamilleProduit_2) ) {%> <option value="<%=idFamille%>"><%=objectTe1.elementAt(1)%></option> <%}else{ if(OppID != null && !OppID.isEmpty() && OppID.length()==16){ String idDevis = ""; String idDevisAss = ""; try{ idDevis = (String) OpportunityBean.lookup(context, "OppEntID:EntCotDevID_", OppID); }catch(Exception e){ logger.warn(e.getMessage()); } try{ idDevisAss = (String) OpportunityBean.lookup(context, "OppEntID:EntCotAssoDevID_", OppID); }catch(Exception e){ logger.warn(e.getMessage()); } if((idDevis!=null && !idDevis.isEmpty() && idDevis.length()==16 && idDevis.contains(OppID)) || (idDevisAss!=null && !idDevisAss.isEmpty() && idDevisAss.length()==16 && idDevisAss.contains(OppID)) || (negSelProd.equals("true"))){ %> <option value="<%=idFamille%>"><%=objectTe1.elementAt(1)%></option> <% } } } }%> </select> </div> </td> </tr> <%} %> <tr valign="top"> <td colspan="2"> <div style="margin-top: 5px;" > <input name="PrdCode" type="text" class="input text" value="<fl:getMessage code="M602D" alt="<Code>"/>" size="20" onfocus="if (this.value=='<fl:getMessage code="M602D" alt="<Code>" js="true"/>') this.value=''" onblur="if(this.value == '') this.value = '<fl:getMessage code="M602D" alt="<Code>" js="true"/>';"> </div> </td> </tr> <tr valign="top"> <td colspan="2"> <div style="margin-top: 5px;" > <input name="PrdName" type="text" class="input text" value="<fl:getMessage code="L6122" alt="<Désignation>"/>" size="20" onfocus="if (this.value=='<fl:getMessage code="L6122" alt="<Désignation>" js="true"/>') this.value=''" onblur="if(this.value == '') this.value = '<fl:getMessage code="L6122" alt="<Désignation>" js="true"/>';"> </div> </td> </tr> <tr> <td align="center" colspan="2"> <div style="margin-top: 10px;" > <a id="searchHref" href="javascript:doSearch();" onmouseover="window.status = '<fl:getMessage code="A2009" alt="Rechercher" js="true"/>'; return true;" onmouseout="window.status = ''; return true;"><img src="<fl:webapp/>/icons/ico/valid_green2_long.gif" border="0" alt="<fl:getMessage code="A2009" alt="Rechercher"/>"></a> </div> </td> </tr> </table> </td> <!-- Fin search area --> <!-- Liste des produits --> <td width="85%" height="180px"> <fl:smallTabs name="ProductList"> <fl:sTab id="ListePrd" hideLink="true" title="<%= Utils.getMessage(session, \"LF185\", false, true, \"Liste d\'articles\")%>"> <table width="100%"> <tr> <td width="100%"> <div class="edealGrid" style="overflow: auto; height: 200px;"> <fl:grid height="200px" name="ListProduct" ajaxUrl="/list_custom_opp_listproduct_ajax.fl"/> </div> </td> </tr> </table> </fl:sTab> </fl:smallTabs> </td> </tr> <!-- Fin Liste des produits --> <!-- Produit Selectionné --> <tr> <td width="15%"> </td> <td width="85%" height="100px"> <fl:smallTabs name="ProductEntry"> <fl:sTab id="PrdEntry" hideLink="true" title="<%= Utils.getMessage(session, \"A0008\", false, true, \"Modifier\")%>"> <div id="createProd" class="edealGrid" style="visibility: hidden;"> <div id="grid-data" class="data"> <table cellpadding="0" cellspacing="0"> <thead><tr valign="top"> <th style="width: 4%;"> <fl:getMessage code="F600A" alt="Image"/> </th> <th style="width: 4%;"> <fl:getMessage code="F2000" alt="Code"/> </th> <th style="width: 6%;"> <fl:getMessage code="F3023" alt="P.U.HT"/> </th> <th style="width: 6%;"> <fl:getMessage code="" alt="P.U.HT Modifié"/> </th> <th style="width: 6%;"> <fl:getMessage code="FF186" alt="Qte en Stock"/> </th> <th style="width: 6%;"> <fl:getMessage code="LF18A" alt="Quantité facturée"/> </th> <th style="width: 12%;"> <fl:getMessage code="FF1FE" alt="Remise"/> </th> <th style="width: 8%;" > <fl:getMessage code="FF132" alt="P. U. HT Vente"/> </th> <th style="width: 8%;" > <fl:getMessage code="FF134" alt="Montant HT"/> </th> <th style="width: 12%;" > <fl:getMessage code="FF130" alt="TVA à appliquer"/> </th> <th style="width: 12%;" > <fl:getMessage code="LF14E" alt="Taxe parafiscale"/> </th> <th style="width: 5%;" > <fl:getMessage code="FF140" alt="Montant TVA"/> </th> <th style="width: 5%;" > <fl:getMessage code="LF14F" alt="Montant TPF"/> </th> <th style="width: 10%;"> <fl:getMessage code="F3026" alt="Prix net"/> </th> <th style="width: 2%;"> </th> </tr></thead> <tbody> <tr valign="top" class="even bean"> <td id="edit_Image" style="width: 4%;"> </td> <td id="edit_Code" style="width: 4%;"> </td> <td id="edit_ProUnitPrice" style="width: 8%; text-align: right;"> </td> <td style="width: 15%; text-align: right;" nowrap> <!-- <input name="ProUnitPrice" style="width: 10%;" > --> <fl:input property="ProUnitPrice" nodiv="true" size="7" format="#,##0.##" onfocus="" onchange="<%= floatChange %>" postText="€" /> </td> <td id="edit_PrdStockActuel_" style="width: 6%; text-align: right;"> </td> <td style="width: 6%; text-align: right;"> <fl:input property="ProQuantity" nodiv="true" size="3" format="#,##0" onchange="<%= intChange %>" onblur="<%= intChange %>"/> </td> <td style="width: 12%;"> <fl:input property="ProRemise_" onchange="calculPrix(this);"/> </td> <td id="edit_ProUnitRemise" style="width: 8%; text-align: right;"> </td> <td id="edit_ProMontantHT" style="width: 8%; text-align: right;"> </td> <td style="width: 12%; text-align: right;" id="edit_PrdTVADefaut_"> <fl:input property="PrdTVADefaut_" except ="<%=valRestr%>" onchange="calculPrix(this);" /> </td> <td style="width: 12%; text-align: right;"> <fl:input property="PrdTaxeParafiscale_" onchange="calculPrix(this);"/> </td> <td id="edit_ProMontantTVA" style="width: 10%; text-align: right;"> </td> <td id="edit_ProMontantTPF" style="width: 10%; text-align: right;"> </td> <td style="width: 10%; text-align: right;"> <input readonly="true" name="ProPrice" id="ProPrice" value=""> </td> <td style="width: 2%; text-align: center;"> <input type="hidden" name="ProID" value=""> <a id="prdItemSubmit" type="submit" href="javascript:saveProdOpp();"><img src="<fl:link url="/icons/ico/cochevalid.gif"/>"></a> </td> </tr> </table> </div></div></div> </fl:sTab> </fl:smallTabs> </td> </tr> <!--Fin Produit Selectionné --> <!-- Liste des produits Selectionnés --> <tr> <td width="15%" align="center" valign="center"> <a href="javascript:doTransfert();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif" value="<fl:getMessage code="A3035" alt="Fermer"/>"></a> </td> <td width="85%"> <fl:smallTabs name="ProductSelected"> <fl:sTab id="PrdSel" hideLink="true" title="<%= Utils.getMessage(session, \"L1035\", false, true, \"Détail\")%>"> <div id="ProdOppTable" class="edealGrid" style="overflow: auto; height: 160px;"> <table class="container" cellpadding="0" style="width: 100%;"> <tr> <td> </td> </tr> </table> </div> </fl:sTab> </fl:smallTabs> </td> </tr> </table> </fl:bigTabs> </fl:form> <fl:title title="<%=Utils.getMessage(session, \"LF186\", false, true, \"Groupe d\'articles\")%>"/> </div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de