<%@page import="java.util.Map.Entry"%> <%@page import="java.math.BigDecimal"%> <%@page session="true" import="com.edeal.frontline.*,java.util.*,java.util.Map.Entry,java.text.*,java.lang.reflect.*, com.edeal.frontline.navigation.*,com.edeal.frontline.helper.custom.*"%> <%@page session="true" import="com.edeal.frontline.Utils"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <%@ page import="com.edeal.frontline.helper.custom.FormHelper" %> <%@ page import="com.edeal.frontline.controller.actions.custom.LoadWebFormPvtAction" %> <% 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 utk = flRequest.getRequestParameterOrAttribute("utk"); if(utk != null) flRequest.setAttribute("utk", utk); String eventCode = flRequest.getRequestParameterOrAttribute("event"); if(eventCode != null) flRequest.setAttribute("event", eventCode); //////////////////////////////////// Bring the enterprise from an utk holder String entID = ""; String sqlQuery = "select PerEntID from Person where PerToken = " + Utils.formatToSQL(context, utk) + " AND PerID like '%"+utk+"%' "; java.sql.Connection con = null; java.sql.Statement stmt = null; java.sql.ResultSet rs = null; try { con = context.getConnection(); stmt = con.createStatement(); rs = stmt.executeQuery(sqlQuery); while (rs.next()) { entID = rs.getString("PerEntID"); } }catch(java.sql.SQLException e){ } finally { try { rs.close(); } catch (Exception e) { } try { stmt.close(); } catch (Exception e) { } try { con.close(); } catch (Exception e) { } } ///////////////////////////////////// String lngId = ""; try{ lngId = (new EnterpriseBean(entID, context)).getCustomProperty("EntRefLngID_").toString(); }catch(Exception e){ lngId = dico.getRefIdByCode("Lna", "Te1", "fr_FR"); } String ctrId = ""; try{ ctrId = (new EnterpriseBean(entID, context)).getEntCtrID(); }catch(Exception e){ ctrId = dico.getRefIdByCode("Ctr", "Te1", "FR"); } String languageID = lngId;//dico.getRefIdByCode("Lna", "Te1", "fr_FR"); String lngCode = dico.getRefCode("EntRefLngID_", languageID); String countryID = ctrId;//dico.getRefIdByCode("Ctr", "Te1", "FR"); FlLocale locale = FlLocale.getInstance(context, languageID, countryID); String init = flRequest.getRequestParameterOrAttribute("init"); String actID = (String)request.getSession().getAttribute("actorID"); String actcode = null; if(actID != null){ ActorBean actor = new ActorBean(actID, context); actcode = actor.getActCode(); } Date expireDt = null; String sExpireDt = ""; String millesime = ""; try{ expireDt = Form.getFrmAvailableToDt(); SimpleDateFormat sfd = new SimpleDateFormat("dd/MM/yyyy"); sExpireDt = sfd.format(expireDt); Calendar cal = Calendar.getInstance(); cal.setTime(expireDt); int year = cal.get(Calendar.YEAR); millesime = String.valueOf(year); }catch(Exception e){ logger.error(" The field 'FrmAvailableToDt' not initialized to get 'Millesime' :" + e.getMessage()); try { millesime = context.getContextParameter("Millesime"); } catch (Exception e2) { logger.error("Option 'Millesime' not found :" + e2.getMessage()); } } Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); int year = cal.get(Calendar.YEAR); Boolean askForStatus = (Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_ASKUSEREVTSTATUS); String enterprise = ""; String perEntID = null; String ctType = null; int entCotisationMil_ = 0; try{ perEntID = Person.getPerEntID(); ctType = Contrat_Helper.getAffiliateType(context, perEntID); enterprise = (new EnterpriseBean(perEntID,context)).getCustomProperty("EntDispName_").toString(); EnterpriseBean ent = new EnterpriseBean(perEntID,context); entCotisationMil_ = (Integer)ent.getCustomProperty("entCotisationMil_"); }catch(FieldNotInitializedException fe){ }catch(FrontlineException fe){ } logger.info("contrat type :: " + ctType); String pvtStatus = ""; try { pvtStatus = ((Integer)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_PVTSTATUS)).toString(); } catch (Exception e) {} int iPvtStatus=Integer.MIN_VALUE; try { iPvtStatus=Integer.parseInt(pvtStatus); } catch (Exception e) {} Vector eventStatusList=(Vector)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_EVTSTATUSLIST); String webIntro = ""; String webHeader = ""; String webConclusion = ""; String webFooter = ""; String webTermsOfUse = ""; try { webIntro = FormHelper.makeHtmlCrLf(Form.getFrmWebIntro()); } catch (Exception e) {} try { webHeader = FormHelper.makeHtmlCrLf(Form.getFrmWebHeader()); } catch (Exception e) {} try { webConclusion = Form.getFrmWebConclusion(); } catch (Exception e) {} try { webFooter = FormHelper.makeHtmlCrLf(Form.getFrmWebFooter()); } catch (Exception e) {} try { webTermsOfUse =FormHelper.makeHtmlCrLf(Form.getFrmWebTermsOfUse()); } catch (Exception e) {} // get the question and response LinkedHashMap> mapQuestionResponse=(LinkedHashMap>)flRequest. getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSEMAP); LinkedHashMap> mapInitialQuestionResponse=(LinkedHashMap>)flRequest. getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_INIT_QUESTIONRESPONSEMAP); LinkedHashMap> mapCotQuestionResponse=(LinkedHashMap>)flRequest. getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSECOTMAP); boolean fDoDisplayIntro=false; try { fDoDisplayIntro=(Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_DISPLAYINTRO); } catch (Exception e) {} // get the link for navigation boolean hasNextQuestions=false; boolean hasPreviousQuestions=false; boolean canValidate= false; boolean canIntegrate = false; boolean isFormPaginated=false; int positionFirstQuestion=-1; int positionLastQuestion=-1; // taritement sur l'évolution EB012 String contratRompu=null; try { //contratRompu = Contrat_Helper.getAffiliateNumber(context, perEntID); contratRompu = Contrat_Helper.getAffiliateNumberByPersonID(context, Person.getPerID()); //ABM correction après retour Sonia if(contratRompu.equals("")){ contratRompu=null; } } catch (Exception e1) { contratRompu=null; } %> <%=Utils.getMessage(context, lngCode, "L63F4", true,true,"R�ponse au questionnaire")%>
<%--
" id="Form_form" method="POST" name="Form_form"> --%> "> "> "> "/>


<%= Utils.getMessage(context, lngCode, "LF1DC", true,true,"N� Affili�") + " : " + Contrat_Helper.getAffiliateNumberByPersonID(context, Person.getPerID())%>  

<%=Utils.getMessage(context, lngCode, "LF22E", true,true,"FEDERATION INTERNATIONALE DES LOGIS")%>
<%-- --%> <%=Utils.getMessage(context, lngCode, "MF10A", true,true,"Questionnaire Guide") + " " + millesime %>


<% if (mapQuestionResponse!=null && mapQuestionResponse.size()>0) { %> <%--
--%>
<%= webHeader %>
<%--

<%= Person.toString()%>

--%>

 <%= Utils.getMessage(context, lngCode, "LF1DD", true,true,"Logis") + " : " + enterprise%>

<%--

<%= Utils.getMessage(context, lngCode, "LF1DC", "N� Affili�") + " : " + Contrat_Helper.getAffiliateNumber(context, perEntID)%>

--%>
<%--

<%=Utils.getMessage(context, lngCode, "LF22B", "A retourner imp�rativement � votre Association Logis")%>
<%=Utils.getMessage(context, lngCode, "LF22C", "AVANT LE")%> <%=sExpireDt %>
<%=Utils.getMessage(context, lngCode, "LF22D", "DERNIER DELAI")%>

--%>


<% // Variables servant au mode pagin� logger.info("************ "+mapQuestionResponse); boolean fFirstQuestion=true; int lfqPosition=Integer.MIN_VALUE; int p = 0; %>
<%= Utils.getMessage(context, lngCode, "LF22F", true,true,"LES RENSEIGNEMENTS INDIQUES FIGURERONT, EN PARTIE, DANS LE GUIDE ") + " " + millesime + " " + Utils.getMessage(context, lngCode, "LF230", "ET SUR INTERNET") %>
<% for (Entry> entry : mapQuestionResponse.entrySet()) { String lfqID = entry.getKey(); String hiddenlnk = ""; LinkFormQuestionBean lfq=new LinkFormQuestionBean(lfqID,context); // Question or paragraph ? String questionID=null; try { questionID=lfq.getLfqFormQuestionID(); } catch (Exception e) {} String paragraph=null; try { paragraph=lfq.getLfqParagraph(); p++;} catch (Exception e) {} Vector resps = entry.getValue(); //Vector initResps = mapInitialQuestionResponse.get(lfqID); String responseID = null; if(resps != null && resps.size() > 0) responseID = resps.elementAt(0); // may be null try { lfqPosition=lfq.getLfqPosition(); } catch (Exception e) {} // removed from here if (paragraph != null) { if(p > 1){ %>
<% } %>
">

<%= Utils.getMessage(context, lngCode, paragraph, true,true, paragraph).replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+"") %>

<% } else { FormQuestionBean question = null; QuestionResponseBean questionResponse=null; try { question = new FormQuestionBean(questionID , context); if (responseID!=null) { questionResponse = new QuestionResponseBean(responseID,context); } } catch (Exception e) { } //request.setAttribute("hiddenlnk", hiddenlnk); request.setAttribute("responses",resps); request.setAttribute("initialresponses",mapInitialQuestionResponse); request.setAttribute("isActorLogis",actcode != null && !"ano".equalsIgnoreCase(actcode)); request.setAttribute("curQuestion",question); // La question a poser request.setAttribute("curQrs",questionResponse); // La r�ponse �ventuellement existente %> <% if (fFirstQuestion) { positionFirstQuestion=lfqPosition-1; %> <% } // first question fFirstQuestion=false; }//N'est pas un paragraph } // while positionLastQuestion=lfqPosition; if(p >= 1){ %>
<%} %> <% int maxproductquantity = 0; int productstested = 0; if(mapCotQuestionResponse != null && !mapCotQuestionResponse.isEmpty()){ String filOppID = null; String depOppID = null; double filTotal = 0; double depTotal = 0; String ids = ""; %>

<%= Utils.getMessage(context, lngCode, "LF09F", "Cotisation") + " " + millesime %>

<%=Utils.getMessage(context, lngCode, "LF22A", "Cotisation FIL") %>:

<% for (Entry> entry : mapCotQuestionResponse.entrySet()) { String lfqID = entry.getKey(); Vector cotResps = entry.getValue(); String filProID = null; ProductOpportunityBean filpro = null; if(cotResps != null && cotResps.size()>0 && !cotResps.isEmpty()){ QuestionResponseBean qrs = null; if(cotResps.elementAt(0) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(0),context); try{ filProID = qrs.getQrsText(); }catch(FieldNotInitializedException e){ } } if(filProID != null){ filpro = new ProductOpportunityBean(filProID, context); String prdCode = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdCode", filProID); String COTFIX = dico.getRefIdByCode("Pl_", "Te1", "COTFIX"); String COTHEB = dico.getRefIdByCode("Pl_", "Te1", "COTHEB"); //double Qunatite_COTFIX = (double) dico.getRefDisp("Pl_", "Nu1", COTFIX); String prdRegles = null; try{ prdRegles = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdRegles_", filProID); }catch(Exception e){ } System.out.println(COTFIX+"--"+COTHEB+"--"+prdRegles+"--"+prdCode); if(prdRegles!=null && (prdRegles.equals(COTHEB))){ Integer productmaxQ = (Integer)ProductOpportunityBean.lookup(context, "ProPrdID:PrdMaxQt_", filProID); if(productmaxQ!=null && productmaxQ>0){ if(productstested==0){ maxproductquantity = productmaxQ; productstested++; }else if(maxproductquantity>productmaxQ){ maxproductquantity = productmaxQ; productstested++; } } } } } } Integer maxOrder = 0; for (Entry> entry : mapCotQuestionResponse.entrySet()) { String lfqID = entry.getKey(); Vector cotResps = entry.getValue(); String filProID = null; String depProID = null; int proQuantity = 0; ProductOpportunityBean filpro = null; String ProMontantTva_ = ""; String ProPrdTva_Val = ""; String ProRemise_ = ""; if(cotResps != null && cotResps.size()>0 && !cotResps.isEmpty()){ QuestionResponseBean qrs = null; if(cotResps.elementAt(0) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(0),context); try{ filProID = qrs.getQrsText(); }catch(FieldNotInitializedException e){ } } if(cotResps.size() > 1 && cotResps.elementAt(1) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(1),context); try{ depProID = qrs.getQrsText(); }catch(FieldNotInitializedException e){ } } if(cotResps.size() > 2 && cotResps.elementAt(2) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(2),context); try{ String quantity = qrs.getQrsText(); Integer temp=0; try{ temp = Integer.valueOf(quantity); }catch(Exception e){ logger.error(e.getMessage()); } proQuantity = (quantity != null && !quantity.isEmpty()) ? temp : 0; }catch(FieldNotInitializedException e){ } } if(filProID != null){ filpro = new ProductOpportunityBean(filProID, context); String prdCode = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdCode", filProID); ///////////////////////////////// String COTFIX = dico.getRefIdByCode("Pl_", "Te1", "COTFIX"); String COTHEB = dico.getRefIdByCode("Pl_", "Te1", "COTHEB"); //double Qunatite_COTFIX = (double) dico.getRefDisp("Pl_", "Nu1", COTFIX); String prdRegles = null; try{ prdRegles = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdRegles_", filProID); }catch(Exception e){ } System.out.println(COTFIX+"--"+COTHEB+"--"+prdRegles+"--"); Integer tmp = null; try{ tmp = (Integer)ProductOpportunityBean.lookup(context, "ProPrdID:PrdOrderQst_", filProID); }catch(Exception e){ } String SortingOrder = null; if(tmp==null) SortingOrder = "0"; else{ SortingOrder = tmp.toString(); if(tmp>maxOrder) maxOrder = tmp; } try{ ProMontantTva_ = ""+((Double)ProductOpportunityBean.lookup(context, "ProMontantTva_", filProID)/ (Integer)ProductOpportunityBean.lookup(context, "ProQuantity", filProID)); }catch(Exception e){ logger.warn(e.getMessage()); ProMontantTva_ = "0.0"; } ProPrdTva_Val = ""+ProductOpportunityBean.lookup(context, "ProPrdTva_:Val", filProID); ProRemise_ = ""+ProductOpportunityBean.lookup(context, "ProRemise_", filProID); Double ProRemise_Nu1 = (double) 0; try{ ProRemise_Nu1 = (Double)dico.getRefDisp("Od_", "Nu1", ProRemise_); } catch (FrontlineException e) { } /* if(prdCode!=null && (prdCode.contains("COTCOM") || prdCode.contains("COTROO"))){ Integer productmaxQ = (Integer)ProductOpportunityBean.lookup(context, "ProPrdID:PrdMaxQt_", filProID); if(productmaxQ!=null && productmaxQ>0){ if(productstested==0){ maxproductquantity = productmaxQ; productstested++; }else if(maxproductquantity>productmaxQ){ maxproductquantity = productmaxQ; productstested++; } } } */ Double ProUnitHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProUnitHTrem_", filProID); Double ProMontantHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProMontantHTrem_", filProID); Double ProMontantTva_2 = (Double)ProductOpportunityBean.lookup(context, "ProMontantTva_", filProID); String prdLabel = null; if(ids != "") ids += "," + prdCode; else ids += prdCode; String prdID = (String)ProductOpportunityBean.lookup(context, "ProPrdID", filProID); String prdName = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdName", filProID); try{ String prdnamelng_ = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdNamelng_", filProID); //prdLabel = prdnamelng_; //prdLabel = (String)dico.getRefDisp(session, "Rd_", "Te1", prdnamelng_); //prdLabel = (String)dico.getRefDisp //RefLocaleBean.loo //FlLocale x = new FlLocale(); try{ String[] fields = {"RelTe1"}; String[][] query = {{"RelRefID = '" + prdnamelng_ + "'" , "RelLngID = '" + languageID + "'" }}; String[] orderBy = {"RelTe1 ASC"}; Vector list = RefLocaleBean.listSummary(context, fields, query, orderBy ); if(list != null && list.size() > 0){ Hashtable line = (Hashtable)list.elementAt(0); prdLabel = (String)line.get("RelTe1"); } }catch(Exception e){ } }catch(Exception e ){ logger.warn(e.getMessage()); } //int proQuantity = (Integer)ProductOpportunityBean.lookup(context, "ProQuantity", filProID); filOppID = (String)ProductOpportunityBean.lookup(context, "ProOppID", filProID); double filProttc = 0; try{ filProttc = (Double)ProductOpportunityBean.lookup(context, "ProPrice", filProID); }catch(FrontlineException e){} double priUnit = 0; try{ ///Avoir priUnit = (Double)ProductOpportunityBean.lookup(context, "ProUnitPrice", filProID); //19/05/2015 //priUnit = (Double)OpportunityHelper.getTTCUnitPrice(context, prdID, perEntID,millesime); }catch(FrontlineException e){} String proPrdTva_ = (String)ProductOpportunityBean.lookup(context, "ProPrdTva_", filProID); proPrdTva_ = dico.getRefCode("ProPrdTva_", proPrdTva_); if("T0".equalsIgnoreCase(proPrdTva_)) proPrdTva_ = "TVA INTRACOM"; double depProttc = 0; if(depProID != null) { try{ depProttc = (Double)ProductOpportunityBean.lookup(context, "ProPrice", depProID); depOppID = (String)ProductOpportunityBean.lookup(context, "ProOppID", depProID); }catch(FrontlineException e){} } %> " id="<%=prdCode %>" value="<%= filProID %>"/> " id="<%=prdCode %>" value="<%= depProID != null ? depProID : "" %>"/> <%-- --%> <% } } } if(filOppID != null) { try{ filTotal = (Double) OpportunityBean.lookup(context, "OppNetApayer_", filOppID); }catch(FrontlineException e){ } filTotal = (new BigDecimal(filTotal)).setScale(2, java.math.RoundingMode.UP).doubleValue(); } if(depOppID != null) { try{ depTotal = (Double) OpportunityBean.lookup(context, "OppNetApayer_", depOppID); }catch(FrontlineException e){ } } %> "/> "/>
<%=Utils.getMessage(context, lngCode, "F203F", "D�signation") %> <%=Utils.getMessage(context, lngCode, "F3023", "P. U. HT") %> <%=Utils.getMessage(context, lngCode, "LF18A", "Quantit� factur�e") %> <%=Utils.getMessage(context, lngCode, "F3025", "Remise sur P.U") %> <%=Utils.getMessage(context, lngCode, "FF132", "P. U. HT Apr�s Remise") %> <%=Utils.getMessage(context, lngCode, "FF134", "Montant HT") %> <%=Utils.getMessage(context, lngCode, "FF130", "TVA � appliquer") %> <%=Utils.getMessage(context, lngCode, "FF140", "Montant TVA") %> <%=Utils.getMessage(context, lngCode, "F3026", "Prix net") %>
<%=(prdLabel != null ? prdLabel : Utils.formatToWeb(prdName, false)) + " (" + proPrdTva_ + " ) " %> <% if(prdRegles!=null && (prdRegles.equals(COTHEB))){ out.print("
"+Utils.getMessage(context, lngCode, "MF101", true,true,"*Plafonn� � XX h�bergements.").replace("XX", maxproductquantity+"")+""); } %>
<%=Utils.formatToWeb(priUnit, false)%> €" value="<%= priUnit %>"/> " name="<%= "qu_" + prdCode%>" value="<%=prdRegles.equals(COTFIX) ? 1 : proQuantity %>" onchange="javascript:calculTotalPrd('<%=prdCode%>');" <%= (!prdRegles.equals(COTHEB)) ? "disabled" : "style=\"background: #00e800;\"" %>/> <%=ProRemise_Nu1.intValue()+"%"%>" value="<%= ProRemise_Nu1.intValue() %>"/> <%=ProUnitHTrem_%> €" value="<%=ProUnitHTrem_%>" /> "><%=ProMontantHTrem_%> € <%=ProPrdTva_Val%>" value="<%= ProPrdTva_Val.substring(0,ProPrdTva_Val.length()-1).replace(",", ".") %>"/> "><%=ProMontantTva_2%> € " disabled="disabled" value="<%= filProttc %>"/> € " value="<%=((double)(ProRemise_Nu1*priUnit)/100) %>"/> " value="<%=ProMontantTva_%>"/> " disabled="disabled" value=""/>" value="<%= depProttc %>"/>
    <%=Utils.getMessage(context, lngCode, "LF18B", "Total HT") %>   <%=Utils.getMessage(context, lngCode, "LF18C", "Total TVA") %> <%=Utils.getMessage(context, lngCode, "LF18D", "Total TTC") %>
  <%=Utils.getMessage(context, lngCode, "F1058", "Total")%>         €

Cotisation Association:

<% depTotal=0; for (Entry> entry : mapCotQuestionResponse.entrySet()) { String lfqID = entry.getKey(); Vector cotResps = entry.getValue(); String filProID2 = null; String depProID = null; int proQuantity = 0; ProductOpportunityBean filpro = null; String ProMontantTva_ = ""; String ProPrdTva_Val = ""; String ProRemise_ = ""; if(cotResps != null && cotResps.size()>0 && !cotResps.isEmpty()){ QuestionResponseBean qrs = null; if(cotResps.elementAt(0) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(0),context); try{ filProID2 = qrs.getQrsText(); }catch(FieldNotInitializedException e){ } } if(cotResps.size() > 1 && cotResps.elementAt(1) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(1),context); try{ depProID = qrs.getQrsText(); }catch(FieldNotInitializedException e){ } } if(cotResps.size() > 2 && cotResps.elementAt(2) != null){ qrs = new QuestionResponseBean(cotResps.elementAt(2),context); try{ String quantity = qrs.getQrsText(); Integer temp=0; try{ temp = Integer.valueOf(quantity); }catch(Exception e){ logger.error(e.getMessage()); } proQuantity = (quantity != null && !quantity.isEmpty()) ? temp : 0; }catch(FieldNotInitializedException e){ } } //depProID = filProID2; if(depProID != null){ filpro = new ProductOpportunityBean(depProID, context); String prdCode = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdCode", depProID); Integer tmp = null; try{ tmp = (Integer)ProductOpportunityBean.lookup(context, "ProPrdID:PrdOrderQst_", depProID); }catch(Exception e){ } String SortingOrder = null; if(tmp==null) SortingOrder = "0"; else{ SortingOrder = tmp.toString(); if(tmp>maxOrder) maxOrder = tmp; } try{ Double x = (Double)ProductOpportunityBean.lookup(context, "ProMontantTva_", depProID); Integer y = (Integer)ProductOpportunityBean.lookup(context, "ProQuantity", depProID); ProMontantTva_ = ""+(x/y); if(ProMontantTva_.contains("NaN"))ProMontantTva_ = "0.0"; }catch(Exception e){ logger.warn(e.getMessage()); ProMontantTva_ = "0.0"; } ProPrdTva_Val = ""+ProductOpportunityBean.lookup(context, "ProPrdTva_:Val", depProID); ProRemise_ = ""+ProductOpportunityBean.lookup(context, "ProRemise_", depProID); Double ProRemise_Nu1 = (double) 0; try{ ProRemise_Nu1 = (Double)dico.getRefDisp("Od_", "Nu1", ProRemise_); } catch (FrontlineException e) { } /* String prdLabel = null; if(ids != "") ids += "," + prdCode; else ids += prdCode; String prdID = (String)ProductOpportunityBean.lookup(context, "ProPrdID", depProID); String prdName = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdName", depProID); String prdNameTemp = prdName; String prdnamelng_ = ""; try{ prdnamelng_ =(String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdNamelng_", depProID); prdName = (String)dico.getRefDisp(session, "Rd_", "Te1", prdnamelng_); }catch(Exception e){ prdName=prdNameTemp; } try{ try{ String[] fields = {"RelTe1"}; String[][] query = {{"RelRefID = '" + prdnamelng_ + "'" , "RelLngID = '" + languageID + "'" }}; String[] orderBy = {"RelTe1 ASC"}; Vector list = RefLocaleBean.listSummary(context, fields, query, orderBy ); if(list != null && list.size() > 0){ Hashtable line = (Hashtable)list.elementAt(0); prdLabel = (String)line.get("RelTe1"); } }catch(Exception e){ } }catch(Exception e ){ logger.warn(e.getMessage()); } */ Double ProUnitHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProUnitHTrem_", depProID); Double ProMontantHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProMontantHTrem_", depProID); Double ProMontantTva_2 = (Double)ProductOpportunityBean.lookup(context, "ProMontantTva_", depProID); String prdLabel = null; if(ids != "") ids += "," + prdCode; else ids += prdCode; String prdID = (String)ProductOpportunityBean.lookup(context, "ProPrdID", depProID); String prdName = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdName", depProID); try{ String prdnamelng_ = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdNamelng_", depProID); //prdLabel = prdnamelng_; //prdLabel = (String)dico.getRefDisp(session, "Rd_", "Te1", prdnamelng_); //prdLabel = (String)dico.getRefDisp //RefLocaleBean.loo //FlLocale x = new FlLocale(); try{ String[] fields = {"RelTe1"}; String[][] query = {{"RelRefID = '" + prdnamelng_ + "'" , "RelLngID = '" + languageID + "'" }}; String[] orderBy = {"RelTe1 ASC"}; Vector list = RefLocaleBean.listSummary(context, fields, query, orderBy ); if(list != null && list.size() > 0){ Hashtable line = (Hashtable)list.elementAt(0); prdLabel = (String)line.get("RelTe1"); } }catch(Exception e){ } }catch(Exception e ){ logger.warn(e.getMessage()); } if(!prdCode.contains("COTROO") && !prdCode.contains("COTCOM")) proQuantity = (Integer)ProductOpportunityBean.lookup(context, "ProQuantity", depProID); depOppID = (String)ProductOpportunityBean.lookup(context, "ProOppID", depProID); double filProttc = 0; try{ filProttc = (Double)ProductOpportunityBean.lookup(context, "ProPrice", depProID); }catch(FrontlineException e){} double priUnit = 0; try{ ///Avoir priUnit = (Double)ProductOpportunityBean.lookup(context, "ProUnitPrice", depProID); //19/05/2015 //priUnit = (Double)OpportunityHelper.getTTCUnitPrice(context, prdID, perEntID,millesime); }catch(FrontlineException e){} String proPrdTva_ = (String)ProductOpportunityBean.lookup(context, "ProPrdTva_", depProID); proPrdTva_ = dico.getRefCode("ProPrdTva_", proPrdTva_); if("T0".equalsIgnoreCase(proPrdTva_)) proPrdTva_ = "TVA INTRACOM"; double depProttc = 0; if(depProID != null) { try{ depProttc = proQuantity * priUnit; depTotal += depProttc; depOppID = (String)ProductOpportunityBean.lookup(context, "ProOppID", depProID); }catch(FrontlineException e){} } %> <%-- " id="<%=prdCode %>" value="<%= filProID %>"/> --%> " id="<%=prdCode %>" value="<%= depProID != null ? depProID : "" %>"/> <%-- --%> <%-- --%> <% } } } depTotal = (new BigDecimal(depTotal)).setScale(2, java.math.RoundingMode.UP).doubleValue(); %> <%-- --%>
<%=Utils.getMessage(context, lngCode, "F203F", "D�signation") %> <%=Utils.getMessage(context, lngCode, "F3023", "P. U. HT") %> <%=Utils.getMessage(context, lngCode, "LF18A", "Quantit� factur�e") %> <%=Utils.getMessage(context, lngCode, "F3025", "Remise sur P.U") %> <%=Utils.getMessage(context, lngCode, "FF132", "P. U. HT Apr�s Remise") %> <%=Utils.getMessage(context, lngCode, "FF134", "Montant HT") %> <%=Utils.getMessage(context, lngCode, "FF130","TVA � appliquer") %> <%=Utils.getMessage(context, lngCode, "FF140", "Montant TVA") %> <%=Utils.getMessage(context, lngCode, "F3026", "Prix net") %>
<%=(prdLabel != null ?prdLabel : Utils.formatToWeb(prdName, false)) + " (" + proPrdTva_ + " ) " %> <% if(prdCode!=null && (prdCode.contains("COTCOM") || prdCode.contains("COTROO"))){ out.print("
"+Utils.getMessage(context, lngCode, "MF101", true,true,"*Plafonn� � XX h�bergements.").replace("XX", maxproductquantity+"")+""); } %>
" name="<%= "2qu_" + prdCode%>" value="<%= proQuantity %>" disabled="disabled" /> X<% if(prdCode!=null && (prdCode.contains("COTCOM") || prdCode.contains("COTROO"))){ out.print("*"); } %> (<%=Utils.formatToWeb(priUnit, false)%> €" value="<%= priUnit %>"/> <% String calcString = " + "; // BigDecimal bd = new BigDecimal(ProMontantTva_); // bd = bd.setScale(2, java.math.RoundingMode.UP); // String doubleVal = ""+bd.doubleValue(); String doubleVal = new DecimalFormat("##.##").format(Double.parseDouble(ProMontantTva_)); doubleVal = doubleVal.replace(",", "."); if(doubleVal.indexOf('.')==doubleVal.length()-2) doubleVal += "0"; if(doubleVal.indexOf('.')==-1) doubleVal += ".00"; calcString += doubleVal+" €"; calcString +=" - "; // bd = new BigDecimal(((double)(ProRemise_Nu1*priUnit)/100)); // bd = bd.setScale(2, java.math.RoundingMode.UP); // doubleVal = ""+bd.doubleValue(); doubleVal = new DecimalFormat("##.##").format(((double)(ProRemise_Nu1*priUnit)/100)); doubleVal = doubleVal.replace(",", "."); if(doubleVal.indexOf('.')==doubleVal.length()-2) doubleVal += "0"; if(doubleVal.indexOf('.')==-1) doubleVal += ".00"; calcString +=doubleVal+" €"; calcString +=" ) (TVA:"+ProPrdTva_Val+" ,Remise:"+ProRemise_Nu1.intValue()+"%) "; calcString = calcString.replaceAll(java.util.regex.Pattern.quote(" ,Remise:0%"),""); calcString = calcString.replaceAll(java.util.regex.Pattern.quote(" - 00.00 €"),""); calcString = calcString.replaceAll(java.util.regex.Pattern.quote(" + 00.00 €"),""); out.print(calcString); %> = " disabled="disabled" value="<%= filProttc %> €" /> " disabled="disabled" value=""/> " value="<%=((double)(ProRemise_Nu1*priUnit)/100) %>"/> " value="<%=ProMontantTva_%>"/> " value="<%= depProttc %> €" />
<%=(prdLabel != null ? prdLabel : Utils.formatToWeb(prdName, false)) + " (" + proPrdTva_ + " ) " %> <% if(prdCode!=null && (prdCode.contains("COTCOM") || prdCode.contains("COTROO"))){ out.print("
"+Utils.getMessage(context, lngCode, "MF101", true,true,"*Plafonn� � XX h�bergements.").replace("XX", maxproductquantity+"")+""); } %>
<%=Utils.formatToWeb(priUnit, false)%> €" value="<%= priUnit %>"/> " name="<%= "2qu_" + prdCode%>" value="<%= proQuantity %>" disabled="disabled" /> <%=ProRemise_Nu1.intValue()+"%"%>" value="<%= ProRemise_Nu1.intValue() %>"/> <%=ProUnitHTrem_%> €" value="<%=ProUnitHTrem_%>" /> "><%=ProMontantHTrem_%> € <%=ProPrdTva_Val%>" value="<%= ProPrdTva_Val.substring(0,ProPrdTva_Val.length()-1).replace(",",".") %>"/> "><%=ProMontantTva_2%> € " disabled="disabled" value="<%= filProttc %>"/> € " value="<%=((double)(ProRemise_Nu1*priUnit)/100) %>"/> " value="<%=ProMontantTva_%>"/> " disabled="disabled" value="<%= depProttc %> €"/>" value="<%= depProttc %>"/>
   
    <%=Utils.getMessage(context, lngCode, "LF18B", "Total HT") %>   <%=Utils.getMessage(context, lngCode, "LF18C", "Total TVA") %> <%=Utils.getMessage(context, lngCode, "LF18D", "Total TTC") %>
  <%=Utils.getMessage(context, lngCode, "F1058", "Total")%>         €
<%-- <%=Utils.getMessage(context, lngCode, "MF101", true,true,"*Plafonn� � XX h�bergements.").replace("XX", maxproductquantity+"")%> --%>
    <% String num_aff= Contrat_Helper.getAffiliateNumber(context, perEntID) ;%> <%= Utils.getMessage(context, lngCode, "LF224", true,true,"
  1. Cotisation FIL :") %> <%= Utils.getMessage(context, lngCode, "LF225", true,true,"joindre 1 ch�que bancaire. La FIL �tablira une facture pour cette cotisation
  2. ").replace("xxxxx", num_aff) %> <%--
  3. <%= Utils.getMessage(context, lngCode, "LF226", true,true,"Cotisation d�partementale") %> <%= Utils.getMessage(context, lngCode, "LF227", true,true,"(compl�t�e le cas �ch�ant par l\'Association): joindre 1 ch�que bancaire � l\'ordre de l\'Association qui �tablira une facture pour cette cotisation") %>
  4. --%>

<% String ctID = Contrat_Helper.getActifContractID(context, entID); String code = ""; if(ctID != null && !Utils.isEmpty(ctID)){ code = (String)com.edeal.frontline.custom.Contrat_Bean.lookup(context, "Ct_ModeReg:RefVal", ctID); } if(code!=null && !Utils.isEmpty(code) && "MS".equals(code)){ %> <%= Utils.getMessage(context, lngCode, "MF0FD", true,true,"Vous avez opt� pour le paiement des cotisations par pr�l�vement mensuel. vous n'avez pas de r�glement � effectuer.")%> <% } %>
<% } %> <% } //<% if (mapQuestionResponse!=null) %> <%if(init == null || Utils.isEmpty(init) || !"ok".equalsIgnoreCase(init)){ %> <% } %>
<%= webTermsOfUse %>



<%= Utils.getMessage(context, lngCode, "L639B", true,true,"Chargement ...") %>