<% /****************************************************************************** * 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" contentType="text/plain;charset=UTF-8" import="com.edeal.frontline.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="com.edeal.frontline.helper.custom.OpportunityHelper" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("#,##0.##"); DataDictionary dico = context.getDataDictionary(); String prdName = (String)flRequest.getAttribute("prdName"); if (prdName == null) { prdName = ""; } Integer maxproductquantity = null; try { maxproductquantity = (Integer)Product.getCustomProperty("PrdMaxQt_"); } catch (FrontlineException exc) { maxproductquantity = 50; } Double prdPrice = (Double)flRequest.getAttribute("prdPrice"); if (prdPrice == null) { prdPrice = new Double(0); } // la tva de ligne de produit sinon du produit String tvaVal = ""; try { tvaVal = (String)ProductOpportunity.getCustomProperty("ProPrdTva_"); } catch (FrontlineException e) { try { tvaVal = (String)Product.getCustomProperty("PrdTVADefaut_"); } catch (FrontlineException exc) { } } String valRemise = ""; try { valRemise = (String)ProductOpportunity.getCustomProperty("ProRemise_"); } catch (FrontlineException e) { // il faut initialiser à une remise de 0 try { valRemise = dico.getRefIdByCode("ProRemise_", "REM0"); } catch (FieldNotInitializedException exx) { } } String taxeparaVal = ""; try { taxeparaVal = (String)ProductOpportunity.getCustomProperty("ProPrdTaxeParafiscale_"); } catch (FrontlineException e) { try { taxeparaVal = (String)Product.getCustomProperty("PrdTaxeParafiscale_"); } catch (FrontlineException exc) { } } boolean gestStock = false; try { gestStock = (Boolean)Product.getCustomProperty("PrdGestionStocks_"); } catch (FrontlineException e) { } // image du produit selectionné String PrdPicID = null; try { PrdPicID = (String)Product.getPrdPicID(); } catch (FrontlineException e) { } String imgHtml = ""; if(PrdPicID != null) { String height = null; try{ height = flRequest.getContext().getContextParameter("Devis.Thumbnail.Height"); } catch (FrontlineException fex) { height = "50"; } String width = null; try{ width = flRequest.getContext().getContextParameter("Devis.Thumbnail.Width"); } catch (FrontlineException fex) { width = "80"; } imgHtml = "\"\""; } %> var f = document.forms[0]; window.document.getElementById('edit_Code').innerHTML = ''; window.document.getElementById('edit_Image').innerHTML = '<%=imgHtml%>'; window.document.getElementById('edit_ProUnitPrice').innerHTML = ''; <% if(gestStock) { %> window.document.getElementById('edit_PrdStockActuel_').innerHTML = ''; <% } else { %> window.document.getElementById('edit_PrdStockActuel_').innerHTML = "Non geré"; <%} String oppid = null,prdid=null; try{ oppid=Opportunity.getOppID(); prdid = Product.getPrdID(); %> window.document.getElementById('edit_PrdTVADefaut_').innerHTML = ''; <% }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")); String format = lng.equals("en_US")? "#,###.00":"# ###,00"; %> f.maxproductquantity.value ='<%=maxproductquantity.intValue()+"" %>'; f.ProUnitPrice.value = '<%= df.format(prdPrice.doubleValue()) %>'; f.ProQuantity.value = ''; f.ProPrice.value = ''; f.ProRemise_.value = '<%= valRemise %>'; f.PrdTVADefaut_.value = '<%= tvaVal %>'; if(f.PrdTVADefaut_.getElementsByTagName('option').length == 1) f.PrdTVADefaut_.getElementsByTagName('option')[0].selected = 'selected'; f.PrdTaxeParafiscale_.value = '<%= taxeparaVal %>'; f.ProDesignation.value = '<%= prdName %>'; f.ProID.value = ''; f.ProPrdID.value = ''; f.ProOppID.value = ''; window.calculPrix(f.ProQuantity); f.ProQuantity.select();