<%@page import="com.itextpdf.text.log.SysoLogger"%> <%@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 tiersTypeLabel = flRequest.getParameter("tiersTypeLabel"); String tiersType = flRequest.getParameter("tiersType"); String subId = flRequest.getParameter("subId"); String perId = flRequest.getParameter("perId"); String printOnly = flRequest.getRequestParameterOrAttribute("printOnly"); if(printOnly==null || !"TRUE".equals(printOnly)) printOnly=null; String utk = flRequest.getRequestParameterOrAttribute("utk"); if(utk != null) flRequest.setAttribute("utk", utk); String eventCode = flRequest.getRequestParameterOrAttribute("event"); HashMap>> allQuestionResponses = (HashMap>>)flRequest.getAttribute("allQuestionResponses"); if(eventCode != null) flRequest.setAttribute("event", eventCode); String entID = FormHelper.getEntIDFromUTK(context, utk); 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; 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; //http://u-project2.umanis.com/view.php?id=39749 : Export guide / localités et Millésime String millesime = ""; try{ millesime = String.valueOf((Integer)Form.getCustomProperty("FrmMillesime_")); }catch(Exception e){ logger.error(" The field 'FrmMillesime_' 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(); enterprise = (new EnterpriseBean(perEntID,context)).getCustomProperty("EntDispName_").toString(); }catch(Exception 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 //Tiers_Qst_Resp Tiers_Init_Qst_Resp Tiers_Cot_Qst_Resp LinkedHashMap> mapQuestionResponse = allQuestionResponses.get(tiersTypeLabel + "_Qst_Resp"); LinkedHashMap> mapInitialQuestionResponse = allQuestionResponses.get(tiersTypeLabel + "_Init_Qst_Resp"); LinkedHashMap> mapCotQuestionResponse = new LinkedHashMap(); if(tiersTypeLabel.equals("Tiers")){ mapCotQuestionResponse = allQuestionResponses.get(tiersTypeLabel + "_Cot_Qst_Resp"); } // boolean fDoDisplayIntro=false; // try { // fDoDisplayIntro=(Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_DISPLAYINTRO); // } catch (Exception e) {} boolean isFormPaginated=false; int positionFirstQuestion=-1; int positionLastQuestion=-1; %>
"> <%-- "> --%> "> "/> <% if (mapQuestionResponse!=null && mapQuestionResponse.size()>0) { %> <% // Variables servant au mode pagination logger.info("************ " + mapQuestionResponse); boolean fFirstQuestion=true; boolean isDisplayedQst = true; int lfqPosition=Integer.MIN_VALUE; String lfqTypeTiers_ = null; int p = 0; %> <% 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(); try{ lfqTypeTiers_ = (String)lfq.getCustomProperty("LfqTypeTiers_"); isDisplayedQst = lfqTypeTiers_ == null || lfqTypeTiers_.contains(tiersTypeLabel.substring(0, 1)); }catch(FieldNotInitializedException fnie){ isDisplayedQst = true; } 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 && isDisplayedQst) { 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 if(isDisplayedQst){ 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("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 try{ %> <% }catch(Exception e){ e.printStackTrace(); } if (fFirstQuestion) { positionFirstQuestion=lfqPosition-1; %> <% } // first question fFirstQuestion=false; }//N'est pas un paragraph } // while positionLastQuestion=lfqPosition; if(p >= 1){ %>
<%} %> <% if(mapCotQuestionResponse != null && !mapCotQuestionResponse.isEmpty() && tiersTypeLabel.substring(0, 1).equals("T")){ String filOppID = null; String depOppID = null; double filTotal = 0; double depTotal = 0; String ids = ""; String idsHEB = ""; %>
<%= Utils.getMessage(context, lngCode, "LF09F", "Cotisation") + " " + millesime %>
<%=Utils.getMessage(context, lngCode, "LF22A", "Cotisation FIL") %>:

<% String PrdRegles_ = null; String COTHEB = null; boolean isHEB = false; try { COTHEB = dico.getRefIdByCode("Pl_", "Te1", "COTHEB"); } catch (Exception e) { e.printStackTrace(); } 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){ String prdCode=null; try { filpro = new ProductOpportunityBean(filProID, context); prdCode = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdCode", filProID); } catch (Exception e1) { e1.printStackTrace(); } try { PrdRegles_ = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdRegles_", filProID); System.out.println("PrdRegles_= " + PrdRegles_); } catch (Exception e1) { PrdRegles_ = null; e1.printStackTrace(); } isHEB = PrdRegles_ != null && !PrdRegles_.isEmpty() && PrdRegles_.equals(COTHEB); } } } Integer maxOrder = 0; PrdRegles_ = null; isHEB = false; boolean first_HEB = true; 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 && filProID.length()==16){ String prdCode=null; try { filpro = new ProductOpportunityBean(filProID, context); prdCode = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdCode", filProID); } catch (Exception e1) { e1.printStackTrace(); } Integer maxquantity = null; try{ maxquantity = (Integer)ProductOpportunityBean.lookup(context, "ProPrdID:PrdMaxQt_", filProID); }catch(Exception e){ } 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"; } try{ ProPrdTva_Val = ""+ProductOpportunityBean.lookup(context, "ProPrdTva_:Val", filProID); }catch(Exception e){ logger.warn(e.getMessage()); ProPrdTva_Val = "0.0"; } try{ ProRemise_ = ""+ProductOpportunityBean.lookup(context, "ProRemise_", filProID); }catch(Exception e){ logger.warn(e.getMessage()); ProRemise_ = "0.0"; } Double ProRemise_Nu1 = (double) 0; try{ ProRemise_Nu1 = (Double)dico.getRefDisp("Od_", "Nu1", ProRemise_); } catch (FrontlineException e) { } Double ProUnitHTrem_ = null; Double ProMontantHTrem_ = null; Double ProMontantTva_2 = null; try { ProUnitHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProUnitHTrem_", filProID); ProMontantHTrem_ = (Double)ProductOpportunityBean.lookup(context, "ProMontantHTrem_", filProID); ProMontantTva_2 = (Double)ProductOpportunityBean.lookup(context, "ProMontantTva_", filProID); } catch (Exception e1){ e1.printStackTrace(); } String prdLabel = null; if(ids != "") ids += "," + prdCode; else ids += prdCode; try { PrdRegles_ = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdRegles_", filProID); System.out.println("PrdRegles_= " + PrdRegles_); } catch (Exception e1) { PrdRegles_ = null; e1.printStackTrace(); } isHEB = PrdRegles_ != null && !PrdRegles_.isEmpty() && PrdRegles_.equals(COTHEB); if (isHEB) { if(idsHEB != "") idsHEB += "," + "="+prdCode+"="; else idsHEB += "="+prdCode+"="; } String prdID =null; String prdName =null; String prdnamelng_ =null; try{ prdID = (String)ProductOpportunityBean.lookup(context, "ProPrdID", filProID); prdName = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdName", filProID); prdnamelng_ = (String)ProductOpportunityBean.lookup(context, "ProPrdID:PrdNamelng_", filProID); 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); try{ filOppID = (String)ProductOpportunityBean.lookup(context, "ProOppID", filProID); }catch(FrontlineException e){ e.printStackTrace(); } 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); }catch(FrontlineException e){} String proPrdTva_ =null; try{ proPrdTva_ = (String)ProductOpportunityBean.lookup(context, "ProPrdTva_", filProID); }catch(FrontlineException e){ e.printStackTrace(); } try{ proPrdTva_ = dico.getRefCode("ProPrdTva_", proPrdTva_); }catch(FrontlineException e){ e.printStackTrace(); } 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){} } try{ %> " id="<%=prdCode %>" value="<%= filProID %>"/> " id="<%=prdCode %>" value="<%= depProID != null ? depProID : "" %>"/> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } try{%> <% }catch(Exception e){ e.printStackTrace(); } %> <% } } if(isHEB && first_HEB) first_HEB = false; } 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_ + ") " %> <% }catch(Exception e){ System.out.println(e.getMessage()); } if(isHEB){ out.print("
"+Utils.getMessage(context, lngCode, "MF101", true,true,"*Plafonn� � XX h�bergements.").replace("XX", maxquantity+"")+""); } try{ %>
<%=Utils.formatToWeb(priUnit, false)%> €" value="<%= priUnit %>"/> " id="<%= "qu_" + prdCode%>" name="<%= "qu_" + prdCode%>" value="<%=proQuantity %>" onchange="javascript:calculTotalPrd('<%=prdCode%>');" <%= (isHEB && first_HEB) ? "style=\"background: #00cff3;\"" : "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) %>"/> <% }catch(Exception e){ e.printStackTrace(); } try{%> " value="<%=ProMontantTva_%>"/> <% }catch(Exception e){ e.printStackTrace(); } try{%> " disabled="disabled" value=""/>
    <%=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")%>         €


    <% 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) %>

<% 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(printOnly == null) {%> <%} %> <% } %>