Edit C:\galaxie\Back\galaxie\sales\expenseFile\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.FrontlineException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="java.util.*" %> <%@ page import="java.text.*" %> <%@ page import="com.edeal.frontline.*" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.ExpenseFileBean" id="ExpenseFile" scope="request"/> <jsp:useBean class="com.edeal.frontline.ExpenseKMBean" id="ExpenseKM" scope="request"/> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); String id; String UCAmountTotal = (String) flRequest.getRequestParameterOrAttribute("ExfUCAmountTotal"); String KM = (String) flRequest.getRequestParameterOrAttribute("ExkKM"); String UCAmount = (String) flRequest.getRequestParameterOrAttribute("ExkUCAmount"); String UCAmountPayement = (String) flRequest.getRequestParameterOrAttribute("ExfUCAmountPayement"); try { id = ExpenseFile.getID(); } catch (FieldNotInitializedException fnie) { id = null; } Date begDate; try { begDate = ExpenseFile.getExfBegDate(); } catch (Exception e) { begDate = new Date(); } boolean isAccountant; try { isAccountant = ((Boolean)flRequest.getAttribute("isAccountant")).booleanValue(); } catch (Exception e) { isAccountant = false; } boolean isCreate; try { isCreate = ((Boolean)flRequest.getAttribute("isCreate")).booleanValue(); } catch (Exception e) { isCreate = false; } float cotValue; try { cotValue = ((Float)flRequest.getAttribute("cotValue")).floatValue(); } catch (Exception e) { cotValue = 0; } Date exkDate; try { exkDate = ExpenseKM.getExkDate(); } catch (FieldNotInitializedException e) { exkDate = new Date(); } float exkUCAmount = 0; try { exkUCAmount = ExpenseKM.getExkUCAmount(); } catch (FieldNotInitializedException fnie) { } float exkKM = 0; try { exkKM = ExpenseKM.getExkKM(); } catch (FieldNotInitializedException fnie) { } String exkID; try { exkID = ExpenseKM.getID(); } catch (FieldNotInitializedException e) { exkID = ""; } String route = (String)flRequest.getAttribute("route"); SimpleDateFormat sdf = FlLocale.getInstance(session).getDateFormat(); %> <html> <head> <script type="text/javascript" language="javascript"> var expenseDate = '<%= sdf.format(begDate) %>'; var curDate = '<%= sdf.format(begDate) %>'; var curExkID = '<%= exkID %>'; var varCotValue = '<%= cotValue %>'; var varExkUCAmount = '<%= exkUCAmount %>'; var varExkKM = '<%= exkKM %>'; var dayIndex = 0; function doDateChange(index) { if (eDealXmlhttpArr[index].readyState == 4) { hideWaiting(); expenseDate = eDealXmlhttpArr[index].responseText; document.forms[0].ExfBegDate.value = expenseDate; } } function ajaxDateChange() { var f = document.forms[0]; var url = '<fl:webapp/>/changeExpenseFileDateAjax.fl?date=' + f.ExfBegDate.value; doAjax(url, doDateChange); } function onExfBegDateChange() { setTimeout('ajaxDateChange()', 10); } function expenseReturn(index) { setTimeout('selectDay(' + index + ')', 10); } function changeDay(index) { saveExpenseKM(); selectDay(index); } function saveExpenseKM() { var f = document.forms[0]; if (f.ExkRoute.value == '' && f.ExkKM.value == '' && f.ExkUCAmount.value == '') { return; } var url = '<fl:webapp/>/save_object_ajax.fl?type=ExpenseKM&$$presentFields='; if (curExkID != '') { url += '&id=' + curExkID; } url += '&ExkExfID=<%= ExpenseFile.getID() %>'; url += '&ExkDate=' + curDate; if (f.ExkRoute.value != '') { url += '&ExkRoute=' + escape(f.ExkRoute.value); } if (f.ExkKM.value != '') { url += '&ExkKM=' + f.ExkKM.value; } if (f.ExkUCAmount.value != '') { url += '&ExkUCAmount=' + f.ExkUCAmount.value; } doAjax(url); } function doSubmit() { saveExpenseKM(); return true; } function selectDay(index) { dayIndex = index; switch (dayIndex) { case 0: _grid__Expenses0_js_.render();break; case 1: _grid__Expenses1_js_.render();break; case 2: _grid__Expenses2_js_.render();break; case 3: _grid__Expenses3_js_.render();break; case 4: _grid__Expenses4_js_.render();break; case 5: _grid__Expenses5_js_.render();break; case 6: _grid__Expenses6_js_.render();break; default: _grid__Expenses0_js_.render(); } } function addExpenseEntry() { setTimeout('saveExpenseKM()', 200); var expExfID = '<%= ExpenseFile.getID() %>'; window.open('<fl:webapp/>/edit_expense.fl?expExfID=' + expExfID + '&expDate=' + expenseDate + '&index=' + dayIndex, 'CreateExpense', 'menubar=no, status=no, toolbar=no, scrollbars=no, resizable=yes, width=800, height=360'); } function editExp(id) { var expExfID = '<%= ExpenseFile.getID() %>'; window.open('<fl:webapp/>/edit_expense.fl?id=' + id + '&expExfID=' + expExfID + '&expDate=' + expenseDate + '&index=' + dayIndex, 'CreateExpense', 'menubar=no, status=no, toolbar=no, scrollbars=no, resizable=yes, width=800, height=400'); } function expenseAjaxCallback(arrIndex) { if (eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); eval(eDealXmlhttpArr[arrIndex].responseText); setTimeout('doCallback()', 10); } } function doCallback() { selectDay(dayIndex); } function delExp(id) { if (window.confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>') == true) { var url = '<fl:webapp/>/delete_object_ajax.fl?type=Expense&id=' + id; doAjax(url, expenseAjaxCallback); } } function doBuildRoute() { <% if (route != null) { %> mf = document.forms[0]; if (mf.ExkRoute.value != "") { mf.ExkRoute.value = mf.ExkRoute.value + '\n<%= Utils.formatToJavascript(route) %>'; } else { mf.ExkRoute.value = '<%= Utils.formatToJavascript(route) %>'; } <% } else { %> alert('<fl:getMessage code="M60EA" alt="Il n\\\'y a aucun interaction pour ce jour" js="true"/>'); <% } %> } function computeExfUCAmountPayement(exfUCAdvanced) { mf = document.forms[0]; mf.ExfUCAmountPayement.value = parseFloat(toSysNum(mf.ExfUCAmountTotal.value)) - parseFloat(toSysNum(exfUCAdvanced)); mf.ExfUCAmountPayement.value = checkFloat(mf.ExfUCAmountPayement.value); } function computeExkUCAmount(exkKM) { mf = document.forms[0]; if (mf.ExkUCAmount.value == '') { mf.ExkUCAmount.value = 0; } if (mf.ExfUCAmountTotal.value == '') { mf.ExfUCAmountTotal.value = 0; } if (mf.ExfKM.value == '') { mf.ExfKM.value = 0; } if (mf.ExfUCAmountPayement.value == '') { mf.ExfUCAmountPayement.value = 0; } mf.ExkUCAmount.value = parseFloat(toSysNum(exkKM)) * parseFloat(toSysNum(varCotValue)); mf.ExkUCAmount.value = checkFloat(mf.ExkUCAmount.value); mf.ExfUCAmountTotal.value = parseFloat(toSysNum(mf.ExfUCAmountTotal.value)) - parseFloat(toSysNum(varExkUCAmount)) + parseFloat(toSysNum(mf.ExkUCAmount.value)); mf.ExfUCAmountTotal.value = checkFloat(mf.ExfUCAmountTotal.value); varExkUCAmount = mf.ExkUCAmount.value; mf.ExfKM.value = parseFloat(toSysNum(mf.ExfKM.value)) - parseFloat(toSysNum(varExkKM)) + parseFloat(toSysNum(exkKM)); mf.ExfKM.value = checkFloat(mf.ExfKM.value); varExkKM = exkKM; mf.ExfUCAmountPayement.value = parseFloat(toSysNum(mf.ExfUCAmountTotal.value)) - parseFloat(toSysNum(mf.ExfUCAdvanced.value)); mf.ExfUCAmountPayement.value = checkFloat(mf.ExfUCAmountPayement.value); } function doOnLoad(){ _grid__Expenses0_js_.render() } </script> </head> <body> <fl:form action="/save_expenseFile.fl" bean="ExpenseFile"> <input type="hidden" name="index" value="" /> <input type="hidden" name="ExkExfID" value="<%= ExpenseFile.getID() %>" /> <input type="hidden" name="ExkDate" value="<%= Utils.formatToWeb(session, exkDate, false) %>" /> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L645C\", false, true, \"Note de frais\") %>" ou="<%= \"/edit_expenseFile.fl\" + (id != null ? \"?id=\" + id : \"\")%>"> <table class="container" cellpadding="0"> <tr> <td colspan="3"> <table class="container" cellpadding="0"> <tr> <td class="labelTitreFiche"><fl:label code="L64DB" labelClassName="labelTitreFiche"/></td> <td style="padding-left: 10px; width: 430px;"> <input type="text" class="input text chpsTextObligatoire" value="<fl:getProperty name="ExpenseFile" property="ExfActID" alt=" " bean="true"/><fl:getProperty name="ExpenseFile" property="ExfNumEmployee" alt=" " preText="( " postText=")" />" readOnly/> </td> <td style="padding-left: 10px; width: 115px;"><fl:label code="F6145"/></td> <td style="padding-left: 10px;" nowrap> <fl:input property="ExfBegDate" mandatoryMsgCode="M2006"/> </td> </tr> </table> </td> </tr> <tr><td colspan="3" class="ligne_separation"></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldRead property="ExfNumber"/> <fl:fieldEdit property="ExfUCAmountTotal" labelCode="F6044" onfocus="this.blur();" postText=" €"/> <fl:fieldEdit property="ExkRoute" labelCode="L6136" rows="2"/> <fl:fieldEdit property="ExkKM" labelCode="F611B" postText=" km" onchange="computeExkUCAmount(this.value);"/> <fl:fieldEdit property="ExkUCAmount" labelCode="L3055" postText=" €" onfocus="this.blur();" /> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="ExfKM" labelCode="F6043" onfocus="this.blur();"/> <% if (isAccountant) { String errMsg = Utils.getMessage(session,"M302F", true, "Format de nombre incorrect. Veuillez corriger."); String onBlurText = "ctrlNumField(this, 'float', '" + errMsg + "');"; %> <fl:fieldEdit property="ExfUCAdvanced" labelCode="F6045" postText=" €" onchange="v=this.value; if (ctrlNumField(this, 'float')) { computeExfUCAmountPayement(v) } else {this.value=v; this.form.ExfUCAmountPayement.value = '';}" onblur="<%= onBlurText %>"/> <% } else { %> <fl:fieldEdit property="ExfUCAdvanced" labelCode="F6045" postText=" €" onfocus="this.blur()"/> <% } %> <fl:fieldEdit property="ExfUCAmountPayement" labelCode="F6046" onfocus="this.blur();" postText=" €"/> <fl:fieldEdit property="ExfEmitDate" labelCode="F6047" readOnly="true"/> <fl:fieldEdit property="ExfMangerDate" labelCode="F6048" readOnly="true"/> <fl:fieldEdit property="ExfAccountDate" labelCode="F6049" readOnly="true"/> <% if (isAccountant) { %> <fl:fieldEdit property="ExfPayementDate" labelCode="F604A" readOnly="true"/> <% } else { %> <fl:fieldEdit property="ExfPayementDate" labelCode="F604A" readOnly="true"/> <% } %> </table> </td> </tr> <tr class="ligne_separation"><td colspan="3"></td></tr> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:getMessage code="F2024" alt="Notes"/></td> </tr> <tr> <td class="dataValue noPaddingLeft"><fl:input property="ExfNotes" nodiv="false"/></td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> </table> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"/> <fl:smallTabs name="ExfRead"> <fl:sTab id="MONDAY" title="<%= Utils.getMessage(session, \"F60A0\", \"Lundi\") %>" onselect="changeDay(0);"> <div> <fl:grid name="Expenses0" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\" + id + \"&index=0\" %>"/> </div> </fl:sTab> <fl:sTab id="TUESDAY" title="<%= Utils.getMessage(session, \"F60A1\", \"Mardi\") %>" onselect="changeDay(1);"> <div> <fl:grid name="Expenses1" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=1\" %>"/> </div> </fl:sTab> <fl:sTab id="WEDNESDAY" title="<%= Utils.getMessage(session, \"F60A2\", \"Mercredi\") %>" onselect="changeDay(2);"> <div> <fl:grid name="Expenses2" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=2\" %>"/> </div> </fl:sTab> <fl:sTab id="THURSDAY" title="<%= Utils.getMessage(session, \"F60A3\", \"Jeudi\") %>" onselect="changeDay(3);"> <div> <fl:grid name="Expenses3" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=3\" %>"/> </div> </fl:sTab> <fl:sTab id="FRIDAY" title="<%= Utils.getMessage(session, \"F60A4\", \"Vendredi\") %>" onselect="changeDay(4);"> <div> <fl:grid name="Expenses4" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=4\" %>"/> </div> </fl:sTab> <fl:sTab id="SATURDAY" title="<%= Utils.getMessage(session, \"F60A5\", \"Samedi\") %>" onselect="changeDay(5);"> <div> <fl:grid name="Expenses5" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=5\" %>"/> </div> </fl:sTab> <fl:sTab id="SUNDAY" title="<%= Utils.getMessage(session, \"F60A6\", \"Dimanche\") %>" onselect="changeDay(6);"> <div> <fl:grid name="Expenses6" height="150" ajaxUrl="<%= \"/list_expenses.fl?ExfID=\"+id+\"&index=6\" %>"/> </div> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de