Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\sales\cmdgiftcheque_\read.jsp
<%/****************************************************************************** * Copyright (c) 2000-2005 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.DataDictionary" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="org.springframework.util.StringUtils" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Calendar" %> <%@ page import="java.util.Date" %> <%@ page import="com.edeal.frontline.custom.CmdGiftCheque_Bean"%> <%@ page import="com.edeal.frontline.Utils" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.custom.CmdGiftCheque_Bean" id="CmdGiftCheque_" scope="request"/> <jsp:useBean class="com.edeal.frontline.custom.TmpGiftCheques_Bean" id="TmpGiftCheques_" scope="request"/> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <% 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 id = null; try { id = CmdGiftCheque_.getID(); } catch (FieldNotInitializedException fnie) {} Boolean ccGen = false; try { ccGen = CmdGiftCheque_.isCgcGeneratedCcs(); } catch (FieldNotInitializedException fnie) {} String correspondent = null; String cgcCustomerID = null; try { cgcCustomerID = CmdGiftCheque_.getCgcCustomer(); } catch (FieldNotInitializedException fnie) {} // Date du jour : Date dateDuJour = new Date(); // Date du 01/01/ // la RG : /* La date est initialisée au 31/12/AAAA où AAAA: L'année N de la date de création du chèque est entre le 01/01 et le 31/10 inclus : AAAA = N+1 L'année N de la date de création du chèque est entre le 01/11 et le 31/12 inclus : AAAA = N+2 */ Calendar aujourdhui = Calendar.getInstance(); Calendar dateValidite = Calendar.getInstance(); Calendar date3110 = Calendar.getInstance(); Calendar date0101 = Calendar.getInstance(); Calendar date0111 = Calendar.getInstance(); Calendar date3112 = Calendar.getInstance(); String optEndDate = null; try{ optEndDate = context.getContextParameter("GiftCheque_.EndDate"); }catch(FrontlineException e){ logger.error("unable to retrieve GiftCheque_.EndDate", e); } String[] endDate = null; if (!StringUtils.isEmpty(optEndDate)){ endDate = optEndDate.split("/"); } if (StringUtils.isEmpty(optEndDate) || endDate == null || endDate.length != 3){ aujourdhui.setTime(dateDuJour); int anneeenCours = aujourdhui.get(Calendar.YEAR); date3110.set(anneeenCours, Calendar.OCTOBER, 31); date0101.set(anneeenCours, Calendar.JANUARY, 01); date0111.set(anneeenCours, Calendar.NOVEMBER, 01); date3112.set(anneeenCours, Calendar.DECEMBER, 31); if(aujourdhui.after(date0101) && aujourdhui.before(date3110)) { dateValidite.set(anneeenCours, Calendar.DECEMBER, 31); dateValidite.add(Calendar.YEAR, 1); } else if (aujourdhui.after(date0111) && aujourdhui.before(date3112)) { dateValidite.set(anneeenCours, Calendar.DECEMBER, 31); dateValidite.add(Calendar.YEAR, 2); } }else{ try{ dateValidite.set(Integer.parseInt(endDate[2]), Integer.parseInt(endDate[1]) - 1, Integer.parseInt(endDate[0])); }catch(NumberFormatException e){ dateValidite.set(2023, Calendar.DECEMBER, 31); } } Date validityDate = dateValidite.getTime(); TmpGiftCheques_.setTg_DateValidite(validityDate); // Désignation du chèque cadeau String giftChequeDesignation = null; try { giftChequeDesignation = TmpGiftCheques_.getTg_DesignationCC(); } catch (FieldNotInitializedException fnie) { } // Désignation de type saisie libre String giftChequeRandomDesignationID = null; try { giftChequeRandomDesignationID = (String) dico.getRefIdByCode("GchDesignation", "RAND"); } catch (Exception e) { giftChequeRandomDesignationID =""; } %> <script language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></script> <script type="text/javascript" language="javascript"> function refreshCheques() { if(<%=ccGen%>){ refreshTempCCs(); } else{ refreshTempCCPbl(); } } function setChampMontant() { var f = window.document.cheques; var designSelect = f.Tg_DesignationCC; // pour le random cheque value if(designSelect.value == "<%=giftChequeRandomDesignationID%>"){ document.getElementById("Montant_Unitaire").style.display = 'table'; } else { document.getElementById("Montant_Unitaire").style.display = 'none'; } } function refreshCCs() { _grid__GCH_EMB_js_.render(); } function refreshTempCCs() { _grid__CMD_GIFTCH_js_.render(); } function refreshTempCCPbl() { _grid__CMD_GIFPBL_js_.render(); } function doOnLoad() { refreshCheques(); setChampMontant(); } function doRefresh() { window.top.location.reload(); } function doGenerate() { window.location = '<fl:link url="<%= \"/generer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>'; } function doNewNumInvalider(idGch) { var link = '<fl:link url="<%= \"/generer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>' link = link + '&initInvGchID=' + idGch; //alert(link); window.location = link; } function doGchDesignationChange() { doRefreshGiftCheque(); } function deleteMarkedGiftChqs(envID){ if (confirm('<fl:getMessage code="MF0CA" alt="Etes-vous sûr de vouloir enlever cette ligne de commande de chèques cadeaux?" js="true"/>')) { doAjax('<fl:webapp/>/delete_object_ajax.fl?type=TmpGiftCheques_&id=' + envID , waitNrefreshSLChqs); } } function addCheque() { var f = window.document.cheques; var designSelect = f.Tg_DesignationCC; if(f.Tg_DesignationCC.value == '') { alert('<fl:getMessage code="MF0C8" alt="Vous devez saisir la désignation du chèque cadeau." js="true"/>'); f.Tg_DesignationCC.focus(); return; } if(f.Tg_DateValidite.value == '') { alert('<fl:getMessage code="MF0C6" alt="Vous devez saisir la date de validité." js="true"/>'); f.Tg_DateValidite.focus(); return; } if(f.Tg_MontantUnitaire.value == '' && designSelect.value == "<%=giftChequeRandomDesignationID%>") { alert('<fl:getMessage code="MF0C9" alt="Vous devez saisir le prix unitaire du chèque cadeau." js="true"/>'); f.Tg_MontantUnitaire.focus(); return; } if(f.Tg_Quantite.value == '' || f.Tg_Quantite.value < 0) { alert('<fl:getMessage code="MF0CC" alt="Vous devez saisir la Qte du chèque cadeau." js="true"/>'); f.Tg_Quantite.focus(); return; } var args = '&Tg_CmdGiftChequeID=<%=id%>'; if (f.Tg_MontantUnitaire.value != '') { args += '&Tg_MontantUnitaire=' + encodeURIComponent(f.Tg_MontantUnitaire.value); } if (f.Tg_DesignationCC.value != '') { args += '&Tg_DesignationCC=' + encodeURIComponent(f.Tg_DesignationCC.value); } if (f.Tg_Quantite.value != '') { args += '&Tg_Quantite=' + encodeURIComponent(f.Tg_Quantite.value); } if (f.Tg_DateValidite.value != '') { args += '&Tg_DateValidite=' + encodeURIComponent(f.Tg_DateValidite.value); } /* if (f.Tg_DeadlineDt.value != '') { args += '&Tg_DeadlineDt=' + encodeURIComponent(f.Tg_DeadlineDt.value); } */ if (f.Tg_Beneficiary.value != '') { args += '&Tg_Beneficiary=' + encodeURIComponent(f.Tg_Beneficiary.value); } //var ajaxURL = '<fl:link url="/save_object_ajax.fl?type=OtherGuides_&$$presentFields="/>' + args; var ajaxURL = '<fl:link url="/save_ligne_chequecadeau_ajax.fl?"/>' + args; f.Tg_Quantite.value = ''; /*f.Tg_DeadlineDt.value = '';*/ f.Tg_Beneficiary.value = ''; doAjax(ajaxURL, waitNrefreshSLChqs); } function waitNrefreshSLChqs(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { var rtrn = trimStr(eDealXmlhttpArr[arrIndex].responseText); if (rtrn == '') { refreshCheques(); window.location.reload(); } else { hideWaiting(); } } } function ConfirmerImpression(GchId) { var args = '&initGchID=' + GchId; var ajaxURL = '<fl:link url="/confirmer_impression_cheque_cadeau.fl?"/>' + args; doAjax(ajaxURL, waitNrefreshSLChequesConf); } <%-- window.open('<fl:link list="false" url="<%= \"/generer_gift_calage.fl?$$presentFields=&id=\" + id %>"/>','CmdGiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); --%> function InvaliderChequeCadeau(GchId) { var args = '&initGchID=' + GchId + '&id=' + "<%=id%>"; var link = '<fl:link list="false" url="/demander_num_invalider.fl?$$presentFields="/>' + args; //alert(link); window.open(link, 'CmdGiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } function RemettreImpression(GchId) { var args = '&initGchID=' + GchId; var ajaxURL = '<fl:link url="/remettre_impression_cheque_cadeau_ajax.fl?"/>' + args; doAjax(ajaxURL, waitNrefreshSLChequesConf); } function waitNrefreshSLChequesConf(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { var rtrn = trimStr(eDealXmlhttpArr[arrIndex].responseText); if (rtrn == '') { refreshCCs(); doRefresh(); } else { hideWaiting(); } } } </script> <input type="hidden" name="Tg_CmdGiftChequeID" value="<%=id%>"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"FF0F2\", \"Commande Cheque Cadeau\") %>" listTitle="<%= Utils.getMessage(session, \"LF140\", \"Liste\") %>" ou="<%= \"read_cmdgiftcheque_.fl\" + (id != null ? \"?id=\" + id : \"\")%>"> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <fl:getProperty name="CmdGiftCheque_" property="CgcCmdNum" alt="" /> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldRead property="CgcReference"/> <fl:fieldRead property="CgcStatusID"/> <% if(ccGen) { %> <fl:fieldRead property="CgcAmount" postText=" €" format="money"/> <%} %> <fl:fieldRead property="CgcDateEcheance"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2" > <table class="data_column" cellpadding="0"> <fl:fieldRead property="CgcPaymentModID"/> <fl:fieldRead property="CgcCmdCanal"/> <fl:fieldRead property="CgcCustomer" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_correspondent.fl\") %>"/> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> </table> <fl:notes name="CgcComments" title="<%= Utils.getMessage(session, \"L64B4\", \"Commentaires\") %>" nbPix="32"><fl:getProperty name="CmdGiftCheque_" property="CgcComments" alt=""/></fl:notes> <% if(!ccGen){ %> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td colspan="5" class="titreFiche"> <fl:getMessage code="LF1C0" alt="Ajout de chèques cadeaux"/> </td> <td class="smallFieldPart"><a href="javascript:addCheque()"> <img src="<fl:webapp/>/icons/ico/save_all_long.gif" id="bt_add" title="<fl:getMessage code="A000F" alt="Ajouter"/>"></a> </td> </tr> </table> <form name="cheques" class="fieldTable"> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="Tg_DesignationCC" mandatoryMsgCode="MF066" onchange="setChampMontant(this.value);"/> <fl:fieldEdit property="Tg_DateValidite" mandatoryMsgCode="MF01D"/> <fl:fieldEdit property="Tg_Quantite" mandatoryMsgCode="MF0CC"/> </table> <table id="Montant_Unitaire" class="data_column" cellpadding="0" style="display:none;"> <fl:fieldEdit property="Tg_MontantUnitaire" mandatoryMsgCode="MF01E" postText=" €" format="money"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2" > <table class="data_column" cellpadding="0"> <%-- <fl:fieldEdit property="Tg_DeadlineDt"/> --%> <fl:fieldEdit property="Tg_Beneficiary"/> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> </table> <table class="container" cellpadding="0"> <tr><td class="ligne_separation_couleur"/></tr> <tr class="ligne_separation"><td></td></tr> </table> </form> <%} %> <fl:smallTabs name="CmdGiftCheque__Tabs"> <fl:sTab id="ListeCCs" title="<%=Utils.getMessage(session, \"LF1BE\", \"Détail de la commande\") %>" onselect="refreshCheques();"> <% if(ccGen){ %> <fl:grid name="CMD_GIFTCH" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=CMD_GIFTCH&Tg_CmdGiftChequeID=\" + id %>"/> <% }else { %> <fl:grid name="CMD_GIFPBL" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=CMD_GIFPBL&Tg_CmdGiftChequeID=\" + id %>"/> <% } %> </fl:sTab> <fl:sTab id="CCs" title="<%=Utils.getMessage(session, \"LF1BF\", \"Liste des chèques cadeaux\") %>" onselect="refreshCCs();"> <fl:grid name="GCH_EMB" ajaxUrl="<%= \"/embedded_list_ajax_cmdgiftcheque_.fl?code=GCH_EMB&GchCgcID=\" + id %>"/> <%-- <fl:grid name="GCH_EMB" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=GCH_EMB&GchCgcID=\" + id %>"/> --%> </fl:sTab> <fl:sTab id="ATTACHMENT" title="<%= Utils.getMessage(session, \"L201C\", \"Documents joints\") %>" > <fl:attach name="CmdGiftCheque_" colID="CgcAttID" edit="false" listFobs="true"/> </fl:sTab> </fl:smallTabs> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de